[jBPM] - JBPM 5.3 Transactional persistence timing issue
by Travers Snyman
Travers Snyman [https://community.jboss.org/people/tsnyman] created the discussion
"JBPM 5.3 Transactional persistence timing issue"
To view the discussion, visit: https://community.jboss.org/message/797838#797838
--------------------------------------------------------------
We have come accross a transactional timing issue using JPBM5.3 as workflow. A simplified use case is as follows:
An external process is kicked off in a workItem handler in this case putting a message on a JMS queue. This could be from a human task. After this , the work item is completed manager.completeWorkItem(workItem.getId(), results);
A reply message is then received on a JMS queue (external process) and and a catch event with signal definition is signalled that the message is received and the catch event signal needs to transition to the next node in the workflow. The signalling after the jms message is received happens as below:
Collection<NodeInstance> nodeInstances = ((WorkflowProcessInstance)processInstance).getNodeInstances();
if (nodeInstances.size() > 0) {
NodeInstance nodeInstance = nodeInstances.iterator().next();
processInstance.signalEvent(nodeName, success);
}
The problem I am facing is that it seems there is a timing problem when the catch event is signalled while the workitem is still being completed (persisted). JBPM throws a null pointer exception and chasing the stack traces indicate that the
kruntime is null. Following is the stack trace
java.lang.NullPointerException
at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:68)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:103)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNodeName(NodeInstanceImpl.java:79)
at org.jbpm.workflow.instance.WorkflowRuntimeException.<init>(WorkflowRuntimeException.java:33)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
The nullpointer exception then causes a transaction rollback as expected
In ProcessInstanceImpl.java line 68, kruntime is null in the getProcess method
public Process getProcess() {
if (this.process == null) {
this.process = kruntime.getKnowledgeBase().getProcess(processId);
}
return this.process;
}
When a thread.sleep(2000) is inserted before the catch event is signalled, kruntime in the above code is not null and the workflow continues properly. This is what is leading me to believe it is a timing issue on the persistence side of completing the workitem.
Ideally I would have liked to have some inspection of the status of the workitem and then wait in a controlled manner for the actual completion of the workitem before the catch event is signalled, but it does not seem that something like that is available in the API.
Does anyone have any suggestions on how to overcome this other than having an arbitry delay before signalling the catch event.
I am using Bitronix as the JTA transaction manager and am using Spring and Hibernate.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/797838#797838]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 2 months
[JBoss Tools] - Using hibernate Tools to generate Sql Script
by Chetan Shinde
Chetan Shinde [https://community.jboss.org/people/chetansh] created the discussion
"Using hibernate Tools to generate Sql Script"
To view the discussion, visit: https://community.jboss.org/message/797369#797369
--------------------------------------------------------------
We wanted to generate SQL Script (DDL) from POJO class which are Hibernate Annotated. I have tried using both hibernate3 maven plugin as well as with the Schema Exporter.
Now this class also has a Sequecne Generator defined, and I was expecting that there would be a Sequence script generated for it as well.
This is what the code looked like in the Entity with respect to the Sequence, the allocationSize here is defined as 50, I have tried using all different sizes.
@Entity @SequenceGenerator(name="sessionInfoIdSeq", sequenceName="SESSIONINFO_ID_SEQ", allocationSize=50)
public class SessionInfo {
@Id @GeneratedValue(strategy = GenerationType.AUTO, generator="sessionInfoIdSeq")
private Integer id;
I am using following JARS:
I am using the following jars : hibernate-tools - 3.2.4.GA, hibernate-core - 3.6.1.Final, hibernate-entitymanager - 3.6.1.Final, hibernate-validator - 4.1.0.Final, hibernate-validator-legacy - 4.0.2.GA and DB related jars.
Now when I tried debugging the code using the SchemaExporter example I found that the class in hibernate-core jar was getting called for generating the sequence text.
The problem is that it was only creating create sequence SESSIONINFO_ID_SEQ;
At line 146 on SequenceGenerator.java it was using
+String[] ddl =+ +dialect.getCreateSequenceStrings(sequenceName) from the Dialect class which happened to be deprecated.+
This method implementation was
+public String[] getCreateSequenceString(String sequenceName) {+
++
+return "create sequence " + sequenceName; //starts with 1, implicitly+
++
+} +
+The Dialect API said instead to usefollowing method.
+
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException {
if ( supportsPooledSequences() ) {
return getCreateSequenceString( sequenceName ) + " start with " + initialValue + " increment by " + incrementSize;
}
throw new MappingException( "Dialect does not support pooled sequences" );
}
I checked the latest APi of the hibernate-core and it too uses the deprecated method.
Any inputs on this would be appreciated. Do I need to raise a JIRA?
I have attached a sample example that I used to generate the Code, SchemaExporter.7z.
Regards,
Chetan
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/797369#797369]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 2 months
Re: [jboss-user] [JBoss Tools] - Future strategy for Tagging JBoss Tools core
by Max Rydahl Andersen
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] commented on the document
"Future strategy for Tagging JBoss Tools core"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-48351#comment-11578
--------------------------------------------------
Not following why branches in git are lighweight affects anything ? its what makes things tolerable right now; but would be even nicer if we didn't have to do it so often ;)
About components then I don't see any changes needed in the components that does not affect the eclipse related code - what are those ? The only change I can recall is the parent pom reference but that is just an old/legacy requirement. It does not need to be updated between builds.
And yes we can still compile from the tag/branch - to ensure things are building but if nothing breaks we don't need to update the actual published plugin.
That is what using Tycho's "Reproducible Version Qualifiers" is for, see wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers
--------------------------------------------------
13 years, 2 months
[jBPM] - Re: Could not connect task client: on ip: 127.0.0.1 - port: 5153
by suman jangama
suman jangama [https://community.jboss.org/people/sumanraoj] created the discussion
"Re: Could not connect task client: on ip: 127.0.0.1 - port: 5153"
To view the discussion, visit: https://community.jboss.org/message/797570#797570
--------------------------------------------------------------
i made this change in the url for eclipse download and install.demo and start.demo works fine
also i have run following commands:
1)ant install.droolsjbpm-eclipse.into.eclipse
2)ant install.jBPM.runtime
I can see the JBPM runtime environment now ..was trying to run the sample project evaluation
still the same error
org.jbpm.workflow.instance.WorkflowRuntimeException: [com.sample.evaluation:1 - Self Evaluation:2] -- Could not connect task client: on ip: 127.0.0.1 - port: 5153
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)
at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)0 13/02 15:34:40,894[main] ERROR service.hornetq.HornetQTaskClientConnector.connect - Unable to connect to server using configuration org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5153&host=127-0-0-1
at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1098)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:320)
at com.sample.ProcessTest.main(ProcessTest.java:31)
Caused by: java.lang.IllegalArgumentException: Could not connect task client: on ip: 127.0.0.1 - port: 5153
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.connect(GenericHTWorkItemHandler.java:158)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:180)
at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
... 13 more
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/797570#797570]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 2 months