[jBPM] - Can Human Task component work with JTA
by Patrick Yang
Patrick Yang [http://community.jboss.org/people/patrickyang] created the discussion
"Can Human Task component work with JTA"
To view the discussion, visit: http://community.jboss.org/message/621185#621185
--------------------------------------------------------------
Hi Krisv,
I am trying to control JBPM5 Process Engine / Human Task / Histroy Log / My own application in one atomic transaction using JTA.
Currently I already configured Process Engine / Histroy Log / My own application with JTA (BTM implemenation), but failed to include Human Task in.
It will always report "A JTA EntityManager cannot use getTransaction()" exception, I tracked the source code, it was because, below code always call getTransaction, and it was not allowed when we config Human Task persistence unit as JTA.
Can you give me some suggestion?
Thanks
private void doOperationInTransaction(final TransactedOperation operation) {
final EntityTransaction tx = em.getTransaction();
try {
if (!tx.isActive()) {
tx.begin();
}
operation.doOperation();
tx.commit();
} finally {
if (tx.isActive()) {
tx.rollback();
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/621185#621185]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[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...]
14 years, 3 months
[jBPM] - Need help with JBPM Process coding
by Raul DM
Raul DM [http://community.jboss.org/people/raahool_16] created the discussion
"Need help with JBPM Process coding"
To view the discussion, visit: http://community.jboss.org/message/630062#630062
--------------------------------------------------------------
Hi,
I am new to JBPM. I have couple of questions:
1. Do I need to learn Drool first to proceed with JBPM ? Is Drool really required or I can do everything with JBPM 5 itself?
2. How can I create rules in JBPM and execute them ?
3. How can I create web application using JBPM library?
4. Do I need to write Java code as we usually do in classes inside packages or we have to write the codes in the Process itself I mean in the bpmn file..!!
For Example: My requirement is as follows:
I need to create a set of Products for my construction company ABC. ABC deals with construction of real estates and based on the requirement of the client it charges the customer.
Scenario 1:
Product : resident house.
rule 1: if (area > 1000 sq feet) then (construction charge = 100$ per square feet) else (construction charge = 90$ per sq feet)
rule 2: if (property is for residential use) then (Service Tax = 5%) else (Service Tax = 8%)
I am confused after goign through some of the documentation on JBPM,
Kindly guide me so that I can proceed with the rule engine.
Raul
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630062#630062]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[JBoss Web Services] - Problems around use of java.lang.Boolean
by Rags Racha
Rags Racha [http://community.jboss.org/people/ragsboss] created the discussion
"Problems around use of java.lang.Boolean"
To view the discussion, visit: http://community.jboss.org/message/630469#630469
--------------------------------------------------------------
I have a method that returns an object of complex type which has a property of type java.lang.Boolean. We need tristate booleans and hence I cannot use native boolean. What I'm noticing is the c# client always gets a null value for this property.
We are using axis 1.4 and I verified that our WSDL file (generated using java2wsdl) does have the Boolean property listed as expected.
<element name="*isFoo*" nillable="*true*" type="*soapenc:boolean*" />
When I captured network traces on the client, I don't see the element corresponding to Boolean property in the soap response at all. I see every other property of the complex type except for this one. Is this a known issue?
I know the backend is fine because we have non-SOAP ways to get to it and they are able to get teh value fine. Given this, I suspect if this may be due to some issue with serialization or something that happens after [server] app code returns objects and before soap response is constructed to be sent to the client.
Any help is greatly appreciated.
Thanks Rags
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630469#630469]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 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...]
14 years, 3 months