[
https://jira.jboss.org/browse/JBRULES-2681?page=com.atlassian.jira.plugin...
]
Gustavo Tenrreiro updated JBRULES-2681:
---------------------------------------
Description:
After an event is processed the session fails to load using JPA persistence.
I ve attached a test case.
It uses a Drools flow file, and a drl file. Both very simple..
The flow file has a "Start" then an action that prints a message to the console,
then "End"
The Drl has one rule that processes an event:
import com.kgcontrols.services.company.standardsRequests.workflow.events.VoteCreatedEvent
declare VoteCreatedEvent
@role(event)
end
rule "testEvents"
when
VoteCreatedEvent() from entry-point "VoteCreatedStream"
then
System.out.println("--------------------------- YEAH the event got
here");
end
I can see the "YEAH the event go here" on the console so I know the rule fired.
But after that, if I try to load the session from the database I get:
--------------------------- YEAH the event got here
ERROR 2010-09-02 10:09:26 Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
Service(KnowledgeStoreServiceImpl.java:106)
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.loadStatefu
lKnowledgeSession(KnowledgeStoreServiceImpl.java:74)
at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeS
ession(JPAKnowledgeService.java:118)
at com.kgcontrols.services.company.standardsRequests.workflow.TestCase.
loadSession(TestCase.java:136)
at com.kgcontrols.services.company.standardsRequests.workflow.TestCase.
start(TestCase.java:64)
at org.apache.jsp.company.standardsRequest.test2_jsp._jspService(org.ap
ache.jsp.company.standardsRequest.test2_jsp:51)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at com.troux.servercommon.usagelog.UsageLogFilter.doFilter(UsageLogFilte
r.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:524)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommon
AccessLogValve.java:495)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSock
et.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
Service(KnowledgeStoreServiceImpl.java:91)
... 31 more
Caused by: java.lang.RuntimeException: Unable to load session snapshot
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
ot(JPASessionMarshallingHelper.java:96)
at org.drools.persistence.session.SingleSessionCommandService.initKsessi
on(SingleSessionCommandService.java:196)
at org.drools.persistence.session.SingleSessionCommandService.<init>(Sin
gleSessionCommandService.java:159)
... 36 more
Caused by: java.lang.NullPointerException
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:135)
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:121)
at org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarsha
ller.java:461)
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMars
haller.java:351)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshall
er.java:205)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarsh
aller.java:91)
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
ot(JPASessionMarshallingHelper.java:91)
... 38 more
ERROR 2010-09-02 10:09:26 [EXCEPTION]
org.apache.jasper.JasperException: java.lang.reflect.InvocationTargetException
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer
vletWrapper.java:510)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:387)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at com.troux.servercommon.usagelog.UsageLogFilter.doFilter(UsageLogFilte
r.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:524)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommon
AccessLogValve.java:495)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSock
et.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:619)
was:
After an event is processed the session fails to load using JPA persistence.
I ve attached a test case.
It uses a Drools flow file, and a drl file. Both very simple..
The flow file has a "Start" then an action that prints a message to the console,
then "End"
The Drl has one rule that processes an event:
import com.kgcontrols.services.company.standardsRequests.workflow.events.VoteCreatedEvent
declare VoteCreatedEvent
@role(event)
end
rule "testEvents"
when
VoteCreatedEvent() from entry-point "VoteCreatedStream"
then
System.out.println("--------------------------- YEAH the event got
here");
end
I can see the "YEAH the event go here" on the console so I know the rule fired.
But after that, if I try to load the session from the database I get:
1.
INFO 2010-09-02 08:28:56 [ERROR] com.kgcontrols.services.company.standardsRequ
2.
ests.workflow.TimerRunner java.lang.reflect.InvocationTargetException
3.
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
4.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
5.
Service(KnowledgeStoreServiceImpl.java:106)
6.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.loadStatefu
7.
lKnowledgeSession(KnowledgeStoreServiceImpl.java:74)
8.
at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeS
9.
ession(JPAKnowledgeService.java:118)
10.
at com.kgcontrols.services.company.standardsRequests.workflow.JPAKnowle
11.
dgeSessionLookup.loadSession(JPAKnowledgeSessionLookup.java:103)
12.
at com.kgcontrols.services.company.standardsRequests.workflow.TimerRunn
13.
er.run(TimerRunner.java:39)
14.
at java.lang.Thread.run(Thread.java:619)
15.
Caused by: java.lang.reflect.InvocationTargetException
16.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
17.
18.
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
19.
orAccessorImpl.java:39)
20.
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
21.
onstructorAccessorImpl.java:27)
22.
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
23.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
24.
Service(KnowledgeStoreServiceImpl.java:91)
25.
... 5 more
26.
Caused by: java.lang.RuntimeException: Unable to load session snapshot
27.
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
28.
ot(JPASessionMarshallingHelper.java:96)
29.
at org.drools.persistence.session.SingleSessionCommandService.initKsessi
30.
on(SingleSessionCommandService.java:196)
31.
at
org.drools.persistence.session.SingleSessionCommandService.<init>(Sin
32.
gleSessionCommandService.java:159)
33.
... 10 more
34.
Caused by: java.lang.NullPointerException
35.
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:135)
36.
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:121)
37.
at org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarsha
38.
ller.java:461)
39.
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMars
40.
haller.java:351)
41.
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshall
42.
er.java:205)
43.
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarsh
44.
aller.java:91)
45.
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
46.
ot(JPASessionMarshallingHelper.java:91)
47.
... 12 more
Drools: Unable to load session snapshot
---------------------------------------
Key: JBRULES-2681
URL:
https://jira.jboss.org/browse/JBRULES-2681
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 5.1.0.FINAL
Environment: Windows Server, SQL Server 2005, Tomcat 5.5, Hibernate, Bitronix
Reporter: Gustavo Tenrreiro
Assignee: Mark Proctor
Attachments: TestCase.java, VoteCreatedEvent.java
After an event is processed the session fails to load using JPA persistence.
I ve attached a test case.
It uses a Drools flow file, and a drl file. Both very simple..
The flow file has a "Start" then an action that prints a message to the
console, then "End"
The Drl has one rule that processes an event:
import
com.kgcontrols.services.company.standardsRequests.workflow.events.VoteCreatedEvent
declare VoteCreatedEvent
@role(event)
end
rule "testEvents"
when
VoteCreatedEvent() from entry-point "VoteCreatedStream"
then
System.out.println("--------------------------- YEAH the event got
here");
end
I can see the "YEAH the event go here" on the console so I know the rule fired.
But after that, if I try to load the session from the database I get:
--------------------------- YEAH the event got here
ERROR 2010-09-02 10:09:26 Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
Service(KnowledgeStoreServiceImpl.java:106)
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.loadStatefu
lKnowledgeSession(KnowledgeStoreServiceImpl.java:74)
at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeS
ession(JPAKnowledgeService.java:118)
at com.kgcontrols.services.company.standardsRequests.workflow.TestCase.
loadSession(TestCase.java:136)
at com.kgcontrols.services.company.standardsRequests.workflow.TestCase.
start(TestCase.java:64)
at org.apache.jsp.company.standardsRequest.test2_jsp._jspService(org.ap
ache.jsp.company.standardsRequest.test2_jsp:51)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at com.troux.servercommon.usagelog.UsageLogFilter.doFilter(UsageLogFilte
r.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:524)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommon
AccessLogValve.java:495)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSock
et.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
Service(KnowledgeStoreServiceImpl.java:91)
... 31 more
Caused by: java.lang.RuntimeException: Unable to load session snapshot
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
ot(JPASessionMarshallingHelper.java:96)
at org.drools.persistence.session.SingleSessionCommandService.initKsessi
on(SingleSessionCommandService.java:196)
at org.drools.persistence.session.SingleSessionCommandService.<init>(Sin
gleSessionCommandService.java:159)
... 36 more
Caused by: java.lang.NullPointerException
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:135)
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:121)
at org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarsha
ller.java:461)
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMars
haller.java:351)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshall
er.java:205)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarsh
aller.java:91)
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
ot(JPASessionMarshallingHelper.java:91)
... 38 more
ERROR 2010-09-02 10:09:26 [EXCEPTION]
org.apache.jasper.JasperException: java.lang.reflect.InvocationTargetException
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer
vletWrapper.java:510)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:387)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at com.troux.servercommon.usagelog.UsageLogFilter.doFilter(UsageLogFilte
r.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:524)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommon
AccessLogValve.java:495)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSock
et.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Thread.java:619)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira