Hi,
I'm using Hibernate 3.3.2.ga, tools 3.2.0, and annotations 3.4.0.GA on a Resin 3.0.19 app server (Java 1.5). I am dying with the exception, "org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags" when trying to initialize a session. A thread that is six years old implies I should change some other models to do LAZY instead of EAGER fetching but I'm not sure how that applies here since I'm not fetching anything yet.
Here's the call I'm making ...
Code:
Session session = sessionFactory.openSession()
And here's the error. Any advice? - Dave
Code:
ERROR [myco.dor.online.interlock.service.ejb.ReportsServiceBean, main 2010-01-19 08:02:08,373]:
=>ReportsServiceBean.getFinancialAssistanceReport() : Failed to generate trading partner report
org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:94)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:98)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:66)
at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:56)
at org.hibernate.loader.entity.BatchingEntityLoader.createBatchingEntityLoader(BatchingEntityLoader.java:126)
at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1765)
at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1769)
at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:3002)
at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:2995)
at org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:712)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:329)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at myco.dor.online.interlock.service.ejb.HibernateFactory.initSessionFactory(HibernateFactory.java:33)
at myco.dor.online.interlock.service.ejb.HibernateFactory.getSessionFactory(HibernateFactory.java:23)
at myco.dor.online.interlock.service.reports.utils.DBUtils.<init>(DBUtils.java:45)
at myco.dor.online.interlock.service.reports.utils.DBUtils.getInstance(DBUtils.java:49)
at myco.dor.online.interlock.service.reports.FinancialAssistanceReport.getReportData(FinancialAssistanceReport.java:24)
at myco.dor.online.interlock.service.reports.AbstractReport.generateHTMLReportToStream(AbstractReport.java:192)
at myco.dor.online.interlock.service.ejb.ReportsServiceBean.getFinancialAssistanceReport(ReportsServiceBean.java:69)
at myco.dor.online.interlock.service.ejb.ReportsServiceBean$$FastClassByCGLIB$$4d0b53c6.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at org.mockejb.interceptor.InterceptorInvoker$CglibMethodInvoker.intercept(InterceptorInvoker.java:95)
at org.mockejb.interceptor.InvocationContext.proceed(InvocationContext.java:177)
at org.mockejb.interceptor.InterceptorInvoker.invoke(InterceptorInvoker.java:53)
at org.mockejb.MockEjbObject.invoke(MockEjbObject.java:147)
at $Proxy2.getFinancialAssistanceReport(Unknown Source)
at myco.dor.online.interlock.test.ejb.ReportsTest.testFinancialAssistanceReport(ReportsTest.java:27)
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:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1072)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:682)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1434)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:632)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:195)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:42)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:83)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:116)
at org.apache.maven.werkz.Goal.fire(Goal.java:691)
at org.apache.maven.werkz.Goal.attain(Goal.java:623)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:712)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265)
at org.apache.maven.cli.App.doMain(App.java:307)
at org.apache.maven.cli.App.main(App.java:217)
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:585)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)