[JBoss jBPM] - Re: Dynamic Fork + External Async WS invocation + problem
by clandestino_bgd
Hi, 1st, thanks for looking into this.
process looks like this: S-F-T-J-E
S: Start state,
D: Dynamic Fork (based on WF variable creates N new tokens),
T: Task Node (on create has Action Handler that calls WS), Task ends when WS make a callback, child tokens wait in
J: Join.
E: End state
- NPE in callback method:
| JbpmTaskInstance taskInstance = (JbpmTaskInstance) context.getTaskInstance(taskInstanceId);
| log.debug("documentId: " + taskInstance.getDocumentId());
|
context.getTaskInstance() returns null, nothing particulary intersesting in stacktrace, simply task instance with that ID cannot be found neither in context nor in DB in that moment.
My understanding of the subject, and please correct me if I am wrong is that in Dynamic Fork which looks like this:
| for (int i = 0; i < numberOfDocuments; i++) {
| String documentId = documentList.get(i);
| // build a new token name
| String tokenName = JPDLConstants.DOCUMENT_PREFIX+ documentId;
| final Token newToken = new Token(rootToken, tokenName);
| newToken.setTerminationImplicit(true);
| context.getJbpmContext().getSession().save(newToken);
| final ExecutionContext newExecutionContext = new ExecutionContext(newToken);
| newExecutionContext.getJbpmContext().getSession().save(newToken);
| node.leave(newExecutionContext);
| }
|
after new ExecutionContext is constructed and node.leave(context) is called for Token #1, the task instance in that token is created, action handler is invoked and then the next token is processed in for loop, but task instance is still not persisted in DB physically.
What I would like to have is when I call this action handler and WS in it, to be able to save that task instance in DB, so callback method can find it immediately.
As far as I know, the default behavior is to propagate execution in ALL outgoing paths, until the wait state is reached in all of the child tokens and then to persist everything in DB.
Making task node async does not remove the problem.
Again as far as I understand async continuations, you just spawn another thread but it does not commit stuff in DB. In other words, in both cases (regular or async task node). task instances will not be created in DB until all of them are not created, and that will happen when all child token paths are calculated while leaving Fork node.
Is this a nonsense? if yes, please help me understand.
Btw, It is completely clear that this problem is not related to WS, but to any async invocation.
Thank you for any hint/idea/comment/question.
milan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206226#4206226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206226
16 years
[JBoss Messaging] - Re: Upgrade from JBM 1.4.0SP# to JBM 1.4.2 GA on JBoss 4.2.2
by stig_dk
Regarding the readme:
"When upgrading an existing installation be sure to update all the configuration files in server/<server name>/deploy/jboss-messaging.sar with the newer versions and replace jboss-messaging.jar in server/<server name>/lib and on the client classpath. You will also need to drop all tables and indexes in the database."
Sounds like overkill to me? What about productions systems with lots of messages in queue, how do you upgrade them. Seems to me that there is no need to drop all the tables. Looks like one new table was added, and three indices droped from 1.4.0 SP3 to 1.4.2 GA. It's no biggie to upgrade the DB by hand, keeping persisted messages in queue.
Would it be possible to include som DDL scripts for the JBM database in the distribution? Would be nice not having to search for them in xx-persistence-service.xml by hand.
cheers
/Stig
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206225#4206225
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206225
16 years
[Installation, Configuration & DEPLOYMENT] - Re: EAR Deployment failed with JBoss 4.2.3 and Mysql
by agusmag
"jaikiran" wrote : anonymous wrote : java.lang.NullPointerException
| | at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
| |
|
| Looks like a bug in Hibernate which was fixed http://forum.hibernate.org/viewtopic.php?t=970823
|
| But that doesn't explain why your application works on Windows and not on Linux. Are you sure there are no other server configuration changes between these two setups. Like jar files, classpath etc...
Yes the two configurations are the same (zipped and unzipped the whole jboss directory including the deploy directory with the web application).
With your suggestion and the information I've found in your blog the bug seems to be resolved now. For anyone facing the same problem, I've done the following:
1) I' have created a "lib" directory in the web application ear directory
2) I put in the lib directory the following jar files (according to the hibernate compatibility matrix):
hibernate (3.2.6 GA)
hibernate-annotations (3.3.0 GA)
hibernate-commons-annotations (3.3.0 GA) (contained in the lib directory of hibernate-annotations)
hibernate-entitymanager (3.3.0 GA)
hibernate-search (3.0.0 GA)
hibernate-validator (3.0.0 GA)
lucene-core-2.4.0 (2.4.0)
Thanks for your help.
A.
P.S.: it's incredible that the bug affects only the Linux system....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206210#4206210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206210
16 years