org.springframework.orm.hibernate4.HibernateSystemException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Hibernate Call in violation of protocol exception
    via by Unknown author,
  • Having a mapped super class: {code:java} @MappedSuperclass public class MappedSupperclass { @OneToOne(fetch = FetchType.LAZY) public Bar bar; } {code} And extending class Foo: {code:java} @Entity public class Foo extends MappedSupperclass { } {code} Trying to add Subgraph: {code:java} EntityGraph<Foo> entityGraph = em.createEntityGraph( Foo.class ); entityGraph.addSubgraph( "bar" ); {code} Throws exception: {noformat} org.hibernate.MappingException: Unknown entity: com.example.hibernate.bugs.inherited.MappedSupperclass at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:776) at org.hibernate.jpa.internal.metamodel.Helper.resolveAttributeSource(Helper.java:47) at org.hibernate.jpa.internal.metamodel.Helper.resolveType(Helper.java:96) at org.hibernate.jpa.graph.internal.AttributeNodeImpl.internalMakeSubgraph(AttributeNodeImpl.java:123) at org.hibernate.jpa.graph.internal.AttributeNodeImpl.makeSubgraph(AttributeNodeImpl.java:98) at org.hibernate.jpa.graph.internal.AbstractGraphNode.addSubgraph(AbstractGraphNode.java:159) at org.hibernate.jpa.graph.internal.EntityGraphImpl.addSubgraph(EntityGraphImpl.java:81) at org.hibernate.jpa.graph.internal.EntityGraphImpl.addSubgraph(EntityGraphImpl.java:26) at com.example.hibernate.bugs.inherited.InheritedEntityGraphTest.attributeNodeInheritanceTest(InheritedEntityGraphTest.java:71) {noformat} Reason: In AttributeNodeImpl,internalMakeSubgraph the declaring type of the attribute is used not the queried managed type. PR will follow
    via by Oliver Breidenbach,
    • org.springframework.orm.hibernate4.HibernateSystemException: Unknown entity: java.util.HashSet; nested exception is org.hibernate.MappingException: Unknown entity: java.util.HashSet at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:218) at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:343) at org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:308) at org.springframework.orm.hibernate4.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:681) at com.mycompany.rm.pmech.common.dao.GenericDAO.saveOrUpdateAll(GenericDAO.java:408) at com.mycompany.rm.pmech.pricingprogram.service.impl.PricingGridServiceImpl.saveLinks(PricingGridServiceImpl.java:318) at com.mycompany.rm.pmech.pricingprogram.service.impl.PricingGridServiceImpl.saveAndPropagateLinks(PricingGridServiceImpl.java:281) at com.mycompany.rm.pmech.pricingprogram.service.impl.PricingGridServiceImpl.createLink(PricingGridServiceImpl.java:235) at com.mycompany.rm.pmech.pricingprogram.service.impl.CopyNodeJobServiceImpl.performGridLinkingForNode(CopyNodeJobServiceImpl.java:498) at com.mycompany.rm.pmech.pricingprogram.service.impl.CopyNodeJobServiceImpl.performGridLinking(CopyNodeJobServiceImpl.java:473) at com.mycompany.rm.pmech.pricingprogram.service.impl.CopyNodeJobServiceImpl.performLinking(CopyNodeJobServiceImpl.java:324) at com.mycompany.rm.pmech.pricingprogram.service.impl.CopyNodeJobServiceImpl.copyNode(CopyNodeJobServiceImpl.java:109) at com.mycompany.rm.pmech.pricingprogram.service.impl.CopyNodeJobServiceImplTest.testCopyNodeAtPGLevelWithX502LinkageWhenTargetSeasonHasNoChildrenShouldSucceed(CopyNodeJobServiceImplTest.java:463) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.extensions.cpsuite.ClasspathSuite.run(ClasspathSuite.java:194) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: org.hibernate.MappingException: Unknown entity: java.util.HashSet at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:1096) at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1443) at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:242) at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:511) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:100) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90) at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:684) at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:676) at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:671) at org.springframework.orm.hibernate4.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:685) at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:340) ... 42 more

    Users with the same issue

    DoktorDoener666DoktorDoener666
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    7 more bugmates