org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks

Hibernate JIRA | Paul Nardone | 5 years ago
  1. 0

    Appears to be an inconsistency between org.hibernate.ejb.criteria.path.PluralAttributePath#resolveRole and naming of CollectionPersisters org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162) at test.Test.testTestSystem(Test.java:136) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111) at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) at $Proxy0.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) ... Removed 26 stack frames Click to hide stack frames org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162) at test.Test.testTestSystem(Test.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1147) at org.testng.TestRunner.privateRun(TestRunner.java:749) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) at org.testng.SuiteRunner.run(SuiteRunner.java:223) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) at org.testng.TestNG.runSuitesLocally(TestNG.java:964) at org.testng.TestNG.run(TestNG.java:900) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) at $Proxy0.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

    Hibernate JIRA | 5 years ago | Paul Nardone
    org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks
  2. 0

    Appears to be an inconsistency between org.hibernate.ejb.criteria.path.PluralAttributePath#resolveRole and naming of CollectionPersisters org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162) at test.Test.testTestSystem(Test.java:136) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111) at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) at $Proxy0.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) ... Removed 26 stack frames Click to hide stack frames org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162) at test.Test.testTestSystem(Test.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1147) at org.testng.TestRunner.privateRun(TestRunner.java:749) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) at org.testng.SuiteRunner.run(SuiteRunner.java:223) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) at org.testng.TestNG.runSuitesLocally(TestNG.java:964) at org.testng.TestNG.run(TestNG.java:900) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) at $Proxy0.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

    Hibernate JIRA | 5 years ago | Paul Nardone
    org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks
  3. 0

    I'm trying to get the PluralAttributePath from a collection defined in a MappedSuperclass {code} @Entity public class Person extends PersonBase { @Basic private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } {code} {code} @MappedSuperclass public abstract class PersonBase { @Id private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } @OneToMany() private Set<Address> addresses = new HashSet<Address>(); public Set<Address> getAddresses() { return addresses; } public void setAddresses(Set<Address> addresses) { this.addresses = addresses; } } {code} Executing the following {code} criteriaQuery = criteriaBuilder.createQuery(Person.class); root = criteriaQuery.from(Person.class); Path<?> pathAddresses = root.get("addresses"); {code} throws the exception {noformat} org.hibernate.MappingException: Unknown collection role: testcase.hibernate.PersonBase.addresses at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:157) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:197) at testcase.hibernate.HibernateTest.testMappedSuperclassPluralAttribute(HibernateTest.java:53) {noformat}

    Hibernate JIRA | 6 years ago | Oliver Ringel
    org.hibernate.MappingException: Unknown collection role: testcase.hibernate.PersonBase.addresses
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I'm trying to get the PluralAttributePath from a collection defined in a MappedSuperclass {code} @Entity public class Person extends PersonBase { @Basic private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } {code} {code} @MappedSuperclass public abstract class PersonBase { @Id private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } @OneToMany() private Set<Address> addresses = new HashSet<Address>(); public Set<Address> getAddresses() { return addresses; } public void setAddresses(Set<Address> addresses) { this.addresses = addresses; } } {code} Executing the following {code} criteriaQuery = criteriaBuilder.createQuery(Person.class); root = criteriaQuery.from(Person.class); Path<?> pathAddresses = root.get("addresses"); {code} throws the exception {noformat} org.hibernate.MappingException: Unknown collection role: testcase.hibernate.PersonBase.addresses at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701) at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58) at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:157) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:197) at testcase.hibernate.HibernateTest.testMappedSuperclassPluralAttribute(HibernateTest.java:53) {noformat}

    Hibernate JIRA | 6 years ago | Oliver Ringel
    org.hibernate.MappingException: Unknown collection role: testcase.hibernate.PersonBase.addresses
  6. 0

    Unknown collection role: Exception

    gilead | 7 years ago | sridheropenid
    org.hibernate.MappingException: Unknown collection role: null

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.MappingException

      Unknown collection role: test.BookDefinition.bookMarks

      at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister()
    2. Hibernate
      SessionFactoryImpl.getCollectionPersister
      1. org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701)
      1 frame
    3. Hibernate EJB
      AbstractPathImpl.get
      1. org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58)
      2. org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52)
      3. org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162)
      3 frames
    4. test
      Test.testTestSystem
      1. test.Test.testTestSystem(Test.java:136)
      1 frame
    5. org.apache.maven
      TestNGProvider.invoke
      1. org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60)
      2. org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106)
      3. org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
      3 frames
    6. SureFire
      ProviderFactory$ClassLoaderProxy.invoke
      1. org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      1 frame
    7. Unknown
      $Proxy0.invoke
      1. $Proxy0.invoke(Unknown Source)
      1 frame
    8. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
      2. org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
      3. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      3 frames