[jBPM] - How to persist a timer
by Stefan Krause
Stefan Krause [http://community.jboss.org/people/krausest] created the discussion
"How to persist a timer"
To view the discussion, visit: http://community.jboss.org/message/629101#629101
--------------------------------------------------------------
I'm failing miserably at persisting a process with a timer.
I'm disposing the session before the timer expires. When I call JPAKnowledgeService.loadStatefulKnowledgeSession with the old session id I'm getting an exception. I've attached a test case with a simple maven project. Just use mvn test to see the issue.
Any help would be appreciated.
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:101)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:69)
at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:131)
at net.stefankrause.jbpm.ProcessRunner.setupSession(ProcessRunner.java:94)
at net.stefankrause.jbpm.ProcessRunner.<init>(ProcessRunner.java:49)
at net.stefankrause.jbpm.tests.TimerPersistence.testTimerPersistence(TimerPersistence.java:34)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:86)
... 28 more
Caused by: java.lang.RuntimeException: Unable to load session snapshot
at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:96)
at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:229)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:177)
... 33 more
Caused by: java.lang.NullPointerException
at org.drools.common.ConcurrentNodeMemories.getNodeMemory(ConcurrentNodeMemories.java:65)
at org.drools.common.AbstractWorkingMemory.getNodeMemory(AbstractWorkingMemory.java:1040)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:231)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:203)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:92)
at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:91)
... 35 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629101#629101]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[JBoss Web Services] - Jboss AS6 unable to call webservices
by M Mudu
M Mudu [http://community.jboss.org/people/max010] created the discussion
"Jboss AS6 unable to call webservices"
To view the discussion, visit: http://community.jboss.org/message/629155#629155
--------------------------------------------------------------
Hi,
I have just received a new WSDL file ( https://sec.paymentexpress.com/WSV1/PXWS.asmx?WSDL https://sec.paymentexpress.com/WSV1/PXWS.asmx?WSDL), from DPS a payment gateway and I have created some Java files with it. These files are then used by my application inside JBoss 6 to invoke the payment gateway and process transaction payments.
I have downloaded Jaxws-ri-2.2.5 from http://jax-ws.java.net/2.2.5/ http://jax-ws.java.net/2.2.5/ and used the jaxws-tools.jar to generate these java files using the wsimport ANT task.
Every file I generated has the jaxws correct version:
{code}
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.5-b01
* Generated source version: 2.2
*
*/
{code}
Here are some info about Java in the Jboss boot.log:
{code}
Java version: 1.6.0_26,Sun Microsystems Inc.
Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java VM: Java HotSpot(TM) 64-Bit Server VM 20.1-b02,Sun Microsystems Inc.
OS-System: Linux 2.6.38-11-generic,amd64
{code}
When I try to make a dummy payment I get the error below?
{code}
2011-09-28 12:05:37,288 ERROR [com.mySite.amf.mySite] (ajp-127.0.0.1-8009-8) Fatal server error +
: java.lang.reflect.UndeclaredThrowableException
at $Proxy417.creditCardPayment(Unknown Source) at com.mySite.amf.mySite.creditCardPayment(mySite.java:2308) [:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406) [:3.0.0.544]
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183) [:3.0.0.544]
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417) [:3.0.0.544]
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878) [:3.0.0.544]
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121) [:3.0.0.544]
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) [:3.0.0.544]
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49) [:3.0.0.544]
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) [:3.0.0.544]
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146) [:3.0.0.544]
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274) [:3.0.0.544]
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377) [:3.0.0.544]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504) [:6.0.0.Final]
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of com.ctc.wstx.io.WstxInputLocation - com.ctc.wstx.io.WstxInputLocation
at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]
at org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60) [:6.0.0.Final]
at org.jboss.ejb3.remoting.IsLocalInterceptor.marshallOrPass(IsLocalInterceptor.java:117) [:1.7.17]
at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:96) [:1.7.17]
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75) [:1.7.17]
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.17]
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) [:1.0.1.GA]
at $Proxy410.invoke(Unknown Source) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]
... 37 more
Caused by: java.lang.InstantiationException: com.ctc.wstx.io.WstxInputLocation
at java.lang.Class.newInstance0(Class.java:340) [:1.6.0_26]
at java.lang.Class.newInstance(Class.java:308) [:1.6.0_26]
at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334) [:6.0.0.Final]
... 81 more
{code}
The com.ctc.wstx.io.WstxInputLocation is a class in the woodstox.jar that came with JAX-WS RI 2.2.5. I understand the InstantiationException:
Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated. The instantiation can fail for a variety of reasons including but not limited to:
* the class object represents an abstract class, an interface, an array class, a primitive type, or void
* the class has no nullary constructor
but I do not know how to prevent this error from occurring. The woodstox.jar is in myApp.ear file.
Any suggestions?
Thanks
Max
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/629155#629155]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[jBPM] - persisted stateful sessions and knowledge base changes
by Jordi Alvarez
Jordi Alvarez [http://community.jboss.org/people/jordi_alvarez] created the discussion
"persisted stateful sessions and knowledge base changes"
To view the discussion, visit: http://community.jboss.org/message/628586#628586
--------------------------------------------------------------
Hello, I am working for an organization for which we have adopted jBPM as the BPM solution. We are making use also of Drools
Expert, which results in a nice combination.
We have stateful sessions persisted in a database in order to record the state of long-time running processes (which are the goal of our
BPM).
In order to make changes to the knowledge-base associated to the stateful sessions that we have, we always redeploy the whole system (ear application + rules + process definitions). This is where we have the problem. Depending on the changes performed to the database, the system is not able to reload the persisted sessions (the change could be for example a change in the condition of a rule). This results in problems and stack traces similar to the following one:
[...]
Caused by: java.lang.RuntimeException: Unable to load session snapshot
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:96)
at org.drools.persistence.session.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:196)
at org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:159)
... 95 more
Caused by: java.lang.ClassCastException: org.drools.reteoo.ObjectTypeNode
at org.drools.marshalling.impl.InputMarshaller.readRightTuple(InputMarshaller.java:401)
at org.drools.marshalling.impl.InputMarshaller.readRightTuples(InputMarshaller.java:391)
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMarshaller.java:326)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:205)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:91)
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:91)
... 97 more
According to some posts (which mainly relate to drools expert), if we were using the knowledge agent we could update the already loaded sessions, which would allow to migrate in-memory sessions from the old database to the new database:
http://drools.46999.n3.nabble.com/Dynamic-updates-of-stateful-sessions-td... http://drools.46999.n3.nabble.com/Dynamic-updates-of-stateful-sessions-td...
http://stackoverflow.com/questions/4368148/is-it-possible-to-add-a-new-ru... http://stackoverflow.com/questions/4368148/is-it-possible-to-add-a-new-ru...
Nevertheless, we absolutely need a way to migrate persisted sessions from the old database to the new one. Even in the situation in which we would allow hot modification of the knowledge base, we cannot have all the stateful sessions loaded in memory when this would happen.
Is there any facility provided by Drools Expert/Flow that allows to perform this operations easily? Is there a way/configuration to
load/save sessions without the need to store/retrieve the rete-tree (and instead recomputing it), which seems to be the problem for these
situations.
We have already posted this information into drools mailing list; but nobody has answered yet. Any help is appreciated!
Many thanks in advance,
Jordi Alvarez
###
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628586#628586]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months