[jBPM] - Persistence and Transaction Management
by Marco Piraccini
Marco Piraccini [http://community.jboss.org/people/mpiraccini] created the discussion
"Persistence and Transaction Management"
To view the discussion, visit: http://community.jboss.org/message/613033#613033
--------------------------------------------------------------
Hi Guys,
I have a very strange behaviour with JBPM5.1 and the persistence.
I do not specify the TransactionManager in the Environment, but i set only the EntityManager. That seems to be correct, looking at the documentation (see 7.1.3 - Configuring Persistence).
My persistence unit is configured in that way:
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="RESOURCE_LOCAL">
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
<property name="hibernate.connection.username" value="xx" />
<property name="hibernate.connection.password" value="xx" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.url" value="jdbc:hsqldb:mem:test" />
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
The strange behaviour is that, when I try to run the code from a junit test using:
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, getKnowledgeSessionConfiguration(),env);
I get this NPE:
18:39:06,775 ERROR [persistence.SingleSessionCommandService] Could not commit session
java.lang.NullPointerException
at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:197)
at org.drools.persistence.jta.JtaTransactionManager.begin(JtaTransactionManager.java:150)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:120)
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:116)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)
at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
There are some quite strange issues about that:
1) Why it uses the JtaTransactionManager even if the transaction-type is "RESOURCE_LOCAL"?
2) If I take a look at the JtaTransactionManager code, the NPE occurs because the UserTransaction is null. That's true, since no-one creates it! Indeed, looking at the SingleSessionCommandService method, the JtaTransactionManager is created in that way:
this.txm = new JtaTransactionManager( env.get( EnvironmentName.TRANSACTION ),
env.get( EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY ),
tm );
...so, I have to specify the EnvironmentName.TRANSACTION to avoid the NPE? If so, why?
Thank you,
Marco.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/613033#613033]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[JBoss Messaging] - JBoss Messaging stops working after few hours
by Prabakaran Periasamy
Prabakaran Periasamy [http://community.jboss.org/people/prabaselvi] created the discussion
"JBoss Messaging stops working after few hours"
To view the discussion, visit: http://community.jboss.org/message/617378#617378
--------------------------------------------------------------
Hello All,
We are using Jboss Messaging 1.4.5 ,Jboss-remoting 2.2.3 SP3 with JBoss 4.2.2 .
We are having two nodes in cluster both are in different physical servers.
Our application is having around 8 different cluster queue and some of the meesages are produced by node 1 and some are from node 2.
The messaging is working fine with normal load,but if we increase the load the system stoped working after 24 hours or 30 hours.
Just to isolate the issue ,we have removed the queue clustering and found system is working with out any issue.
We have tried with jboss-remoting -2.2.4 and faced the same issue.
Attaching the remoting-bisocket-service.xml
Can some one please help me to solve this?
Regards,
Prabakar.
Some part of Thread Dump :
*Thread: RMI RenewClean-[10.21.11.44:1201]* : priority:5,
demon:true, threadId:446, threadState:TIMED_WAITING,
lockName:java.lang.ref.ReferenceQueue$Lock@5351f3bf
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:120)
sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:501)
java.lang.Thread.run(Thread.java:595)
*Thread: http-10.21.11.33-8080-4* : priority:5, demon:true,
threadId:281, threadState:RUNNABLE, lockName:null
org.jboss.remoting.MicroRemoteClientInvoker.terminateLease(MicroRemoteClientInvoker.java:367)
org.jboss.remoting.MicroRemoteClientInvoker.terminateLease(MicroRemoteClientInvoker.java:360)
org.jboss.remoting.Client.disconnect(Client.java:675)
org.jboss.jms.client.remoting.JMSRemotingConnection.stop(JMSRemotingConnection.java:430)
org.jboss.jms.client.container.ConnectionAspect.handleClose(ConnectionAspect.java:192)
sun.reflect.GeneratedMethodAccessor657.invoke(Unknown
Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
org.jboss.jms.client.delegate.ClientConnectionDelegate$close_N4742752445160157748.invokeNext(ClientConnectionDelegate$close_N4742752445160157748.java)
org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:114)
org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
org.jboss.jms.client.delegate.ClientConnectionDelegate$close_N4742752445160157748.invokeNext(ClientConnectionDelegate$close_N4742752445160157748.java)
org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
org.jboss.jms.client.delegate.ClientConnectionDelegate$close_N4742752445160157748.invokeNext(ClientConnectionDelegate$close_N4742752445160157748.java)
org.jboss.jms.client.delegate.ClientConnectionDelegate.close(ClientConnectionDelegate.java)
org.jboss.jms.client.JBossConnection.close(JBossConnection.java:132)
*Thread: http-10.21.11.33-8080-6* : priority:5, demon:true,
threadId:431, threadState:BLOCKED,
lockName:java.lang.Class@54bceb91
java.beans.PropertyEditorManager.findEditor(PropertyEditorManager.java:75)
org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(PropertyEditors.java:365)
org.jboss.remoting.transport.socket.SocketServerInvoker.setup(SocketServerInvoker.java:157)
org.jboss.remoting.transport.bisocket.BisocketServerInvoker.setup(BisocketServerInvoker.java:517)
org.jboss.remoting.ServerInvoker.create(ServerInvoker.java:904)
org.jboss.remoting.transport.Connector.init(Connector.java:412)
org.jboss.remoting.transport.Connector.create(Connector.java:829)
org.jboss.remoting.transport.Connector.start(Connector.java:304)
org.jboss.remoting.Client.addListener(Client.java:1158)
org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:400)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:165)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:80)
org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
org.jboss.jms.client.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:134)
sun.reflect.GeneratedMethodAccessor652.invoke(Unknown
Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)
org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)
org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)
*Thread: http-10.21.11.33-8080-14* : priority:5, demon:true,
threadId:441, threadState:BLOCKED,
lockName:java.lang.Object@31e50754
org.jboss.remoting.InvokerRegistry.destroyClientInvoker(InvokerRegistry.java:229)
org.jboss.remoting.Client.disconnect(Client.java:706)
org.jboss.remoting.Client.addCallbackListener(Client.java:2001)
org.jboss.remoting.Client.addListener(Client.java:1161)
org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:259)
org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:400)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:165)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:80)
org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
org.jboss.jms.client.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:134)
sun.reflect.GeneratedMethodAccessor652.invoke(Unknown
Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)
org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)
org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617378#617378]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - In memory TaskClient without Mina or JMS
by Gergely Dombi
Gergely Dombi [http://community.jboss.org/people/dombi] created the discussion
"In memory TaskClient without Mina or JMS"
To view the discussion, visit: http://community.jboss.org/message/588721#588721
--------------------------------------------------------------
Hi,
We are evaluating jBPM5 to be the backing workflow engine in our current project.
Previously we have implemented a number of successful projects with the jBPM3 stack.
First impressions with jBPM5 is pretty good however I have some questions about the Human Task management.
My understanding on this topic is, tha it is assumed that the web application and the workflow engine
is two separate applications, thus the client needs to communicate via Socket (Mina) or JMS.
In our application it is not the case (and neither was in my past experience).
We have a single binary web application (distributed as a war file) with the workflow engine, and the
workflow client (the web UI) running in the same VM (same webapp by the way).
Is there a way to implement such a solution that enables the client to manually (that is via API call)
set some process variables, specifiy a transition and signal the engine? I mean, without the
async(-like) mechanism provided by default.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588721#588721]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months