[jBPM] - Multiple sessions and thread safety using jBPM persistence
by Jason J
Jason J [https://community.jboss.org/people/jasonjho] created the discussion
"Multiple sessions and thread safety using jBPM persistence"
To view the discussion, visit: https://community.jboss.org/message/773528#773528
--------------------------------------------------------------
For every workflow process I am creating a *new* separate kbase/ksession. So every flow is bound to a unique session and *not* shared.
I have enabled JPA persistence and pass in the following env to *each* new session:
env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
session = createNewSession(env)
session.startProcess(...)
I am getting Hibernate StaleObjectExceptions and OptimisticLocking errors when I perform multiple operations on different processes.
I am not sure what specific DB operation is causing this, but since each process is in its own KSession - how is this even possible?
What database update could be in contention between 2 threads in this case?
I am using jBPM5.2.
Any ideas???
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773528#773528]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[Beginner's Corner] - How to load a file packaged in the .esb?
by Derek Croxton
Derek Croxton [https://community.jboss.org/people/mataratones] created the discussion
"How to load a file packaged in the .esb?"
To view the discussion, visit: https://community.jboss.org/message/773228#773228
--------------------------------------------------------------
I'm trying to load an XSLT file from the .esb package. (This is for a custom action, ignore for the moment why I'm not doing an XsltAction.) The base path, for some reason, is jboss-as\bin\, which is obviously not in the .esb, and when I try to use a relative path that goes up a directory ("../"), I get a MalformedURL exception. A servlet would have a context, but my class is not a servlet, so I don't know how to get at a file inside the .esb. I don't think this is an unusual thing to do, but obviously I have no idea how to do it, and I would appreciate any help.
Derek
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773228#773228]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[jBPM] - problem with JPAKnowledgeService and LocalTaskService
by Ted Pan
Ted Pan [https://community.jboss.org/people/ted.pan] created the discussion
"problem with JPAKnowledgeService and LocalTaskService"
To view the discussion, visit: https://community.jboss.org/message/773504#773504
--------------------------------------------------------------
hi,
When I use JPAKnowledgeService and LocalTaskService, the process won't continue when complete the 2nd Human Task.
the following is the code fragment
| | Environment env = KnowledgeBaseFactory.newEnvironment(); |
| | env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa")); |
| | env.set( EnvironmentName.TRANSACTION_MANAGER,TransactionManagerServices.getTransactionManager()); |
| | | | |
| | Properties properties = new Properties(); |
| | properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory"); |
| | properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory"); |
| | KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties); |
| | KnowledgeBase kbase = readKnowledgeBase(); -- read knowledgebase |
| | |
| | ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); |
| | |
| | EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task"); |
| | org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(emf, SystemEventListenerFactory.getSystemEventListener()); |
| | |
| | LocalTaskService localTaskService = new LocalTaskService(taskService); |
| | LocalHTWorkItemHandler localHTWorkItemHandler = new LocalHTWorkItemHandler(localTaskService,ksession, OnErrorAction.RETHROW); |
| | localHTWorkItemHandler.setLocal(true); |
| | localHTWorkItemHandler.connect(); |
| | ksession.getWorkItemManager().registerWorkItemHandler("Human Task", localHTWorkItemHandler); |
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773504#773504]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months
[JBoss Remoting] - How to verify that an remote interface on client and server side is the same?
by windigo
windigo [https://community.jboss.org/people/windigo] created the discussion
"How to verify that an remote interface on client and server side is the same?"
To view the discussion, visit: https://community.jboss.org/message/773459#773459
--------------------------------------------------------------
Hi,
I've a fatclient consuming a @Remote ejb-service at jboss 6.1.0. Both client and server are sharing the same remote-interface.
To get a proxyobject for the service on client-side looks something like this:
Context context = new ...
EJBService service = context.lookup("jndiurl");
Since the EJBservice was sucessfully deployed at jboss and the jndi-url is sucessfully published I will always get a valid proxy-object on client side. The problem I'm facing quite often is that we update our cilentcode and forget to redeploy the updated server-application which is using this changed EJBService.
For.example after changing a method signature or add a new method in the interface its still possible on client-side to lookup a valid remote-proxy-object from an outversioned @Remote-EJBService on server-side. Only after invoking the changed methods on client side I got a stacktrace like this:
Exception in thread "main" java.lang.NullPointerException
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:345)
at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:586)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:218)
at org.jboss.remoting.Client.invoke(Client.java:2070)
at org.jboss.remoting.Client.invoke(Client.java:879)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
at $Proxy8.invoke(Unknown Source)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
at $Proxy7.bla(Unknown Source)
at EJBServiceClient.main(EJBServiceClient.java:33)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
at $Proxy8.invoke(Unknown Source)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
at $Proxy7.bla(Unknown Source)
at EJBServiceClient.main(EJBServiceClient.java:33)
Is it possible to check wether the packaged interface in the application-jars/ears/wars on client and server side are the same - something like the serialversionUID on entities?
thanks
Felix
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773459#773459]
Start a new discussion in JBoss Remoting at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 5 months