[rules-users] Hibernate

Heyns, Juan Juan.Heyns at lonplats.com
Thu Sep 27 09:27:26 EDT 2007


Hi,



I am getting the following error with 4.0.1, I didn't get this with
4.0.0... Has anything changed in the way Drools works with Hibernate.



Juan



15:24:52,281 ERROR LazyInitializationException:19 - failed to lazily
initialize a collection, no session or session was closed

org.hibernate.LazyInitializationException: failed to lazily initialize a
collection, no session or session was closed

      at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationException(AbstractPersistentCollection.java:358)

      at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationExceptionIfNotConnected(AbstractPersistentCollection.java:350)

      at
org.hibernate.collection.AbstractPersistentCollection.readElementExisten
ce(AbstractPersistentCollection.java:132)

      at
org.hibernate.collection.PersistentSet.contains(PersistentSet.java:153)

      at
org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluat
eCachedLeft(ObjectFactory.java:481)

      at
org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestrict
ion.java:72)

      at
org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstrain
t.java:72)

      at
org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaCo
nstraints.java:117)

      at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:119)

      at
org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTupl
e(CompositeTupleSinkAdapter.java:73)

      at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode
.java:131)

      at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleOb
jectSinkAdapter.java:20)

      at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:160)

      at org.drools.reteoo.Rete.assertObject(Rete.java:176)

      at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)

      at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:
70)

      at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:854)

      at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:826)

      at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:60)

      at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:54)

      at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0.consequence(Rule_Stope_Drilling_work_i
s_evaluated_based_on_the_holes_drilled_and_blasts_0.java:35)

      at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0ConsequenceInvoker.evaluate(Rule_Stope_
Drilling_work_is_evaluated_based_on_the_holes_drilled_and_blasts_0Conseq
uenceInvoker.java:22)

      at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)

      at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:434)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:396)

      at
com.lonmin.bns.domain.rules.RulesEngine.calculateStopeDrillingBonus(Rule
sEngine.java:54)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processDetail(Sto
peDrillingCardPersister.java:371)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processCard(Stope
DrillingCardPersister.java:276)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.process(StopeDril
lingCardPersister.java:69)

      at
com.lonmin.bns.domain.model.ValueObjectPersister.persist(ValueObjectPers
ister.java:38)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersisterTest.testEditStope
DrillingCard(StopeDrillingCardPersisterTest.java:182)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:324)

      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.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:392)

      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:276)

      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:167)

org.hibernate.LazyInitializationException: failed to lazily initialize a
collection, no session or session was closed

      at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationException(AbstractPersistentCollection.java:358)

      at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationExceptionIfNotConnected(AbstractPersistentCollection.java:350)

      at
org.hibernate.collection.AbstractPersistentCollection.readElementExisten
ce(AbstractPersistentCollection.java:132)

      at
org.hibernate.collection.PersistentSet.contains(PersistentSet.java:153)

      at
org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluat
eCachedLeft(ObjectFactory.java:481)

      at
org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestrict
ion.java:72)

      at
org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstrain
t.java:72)

      at
org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaCo
nstraints.java:117)

      at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:119)

      at
org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTupl
e(CompositeTupleSinkAdapter.java:73)

      at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode
.java:131)

      at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleOb
jectSinkAdapter.java:20)

      at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:160)

      at org.drools.reteoo.Rete.assertObject(Rete.java:176)

      at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)

      at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:
70)

      at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:854)

      at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:826)

      at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:60)

      at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:54)

      at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0.consequence(Rule_Stope_Drilling_work_i
s_evaluated_based_on_the_holes_drilled_and_blasts_0.java:35)

      at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0ConsequenceInvoker.evaluate(Rule_Stope_
Drilling_work_is_evaluated_based_on_the_holes_drilled_and_blasts_0Conseq
uenceInvoker.java:22)

      at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)

      at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:434)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:396)

      at
com.lonmin.bns.domain.rules.RulesEngine.calculateStopeDrillingBonus(Rule
sEngine.java:54)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processDetail(Sto
peDrillingCardPersister.java:371)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processCard(Stope
DrillingCardPersister.java:276)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.process(StopeDril
lingCardPersister.java:69)

      at
com.lonmin.bns.domain.model.ValueObjectPersister.persist(ValueObjectPers
ister.java:38)

      at
com.lonmin.bns.domain.model.StopeDrillingCardPersisterTest.testEditStope
DrillingCard(StopeDrillingCardPersisterTest.java:182)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:324)

      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.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:392)

      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:276)

      at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:167)





"Employees of Lonmin Platinum ("Lonplats") are not authorised to conclude
electronic transactions or to enter into electronic agreements on behalf
of Lonplats. Any electronic signature (other than an advanced electronic
signature as defined in the Electronic Communications and Transactions
Act of 2003) added to a data message (such as an email or an attachment
to an (email) ostensibly on behalf of Lonplats by a Lonplats employee shall
not be legally binding on Lonplats and Lonplats shall incur no liability of
any nature whatsoever, directly or indirectly, arising from such act on the
part of it's employee. It is further recorded that nothing (other than an
advanced electronic signature) inserted into any data message
emanating from Lonplats shall be construed as constituting an electronic
signature"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070927/300d1795/attachment.html 


More information about the rules-users mailing list