[JBoss jBPM] - org.hibernate.PersistentObjectException - after creating Tim
by MikeSchulze
Hi,
within my process-definition, I have two state-nodes. When the node-entry event occurs a timer is created. When the 1st timer is done it propagate to the 2nd node. After the propagation and the creation of the 2nd timer I get this exception.
16:50:14,000 ERROR [GraphElement] action threw exception: uninitialized proxy passed to save()
| org.hibernate.PersistentObjectException: uninitialized proxy passed to save()
| at org.hibernate.event.def.DefaultSaveEventListener.reassociateIfUninitializedProxy(DefaultSaveEventListener.java:49)
| at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:59)
| at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
| at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
| at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
| at org.jbpm.db.JobSession.saveJob(JobSession.java:99)
| at org.jbpm.scheduler.db.DbSchedulerService.createTimer(DbSchedulerService.java:43)
| at org.jbpm.scheduler.def.CreateTimerAction.execute(CreateTimerAction.java:79)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor$1.process(SeamUserCodeInterceptor.java:80)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor$ContextualCall.run(SeamUserCodeInterceptor.java:40)
| at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:74)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:257)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:215)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:185)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:169)
| at org.jbpm.graph.def.Node.enter(Node.java:302)
| 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:585)
| at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.def.Node_$$_javassist_139.enter(Node_$$_javassist_139.java)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:393)
| 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:585)
| at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.node.State_$$_javassist_100.leave(State_$$_javassist_100.java)
| at org.jbpm.graph.exe.Token.signal(Token.java:192)
| at org.jbpm.graph.exe.Token.signal(Token.java:155)
| 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:585)
| at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.exe.Token_$$_javassist_154.signal(Token_$$_javassist_154.java)
| at org.jbpm.job.Timer.execute(Timer.java:93)
| 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:585)
| at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.job.Job_$$_javassist_144.execute(Job_$$_javassist_144.java)
| at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:173)
| at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:64)
|
| tritt auf, wenn nach einem Timeraufruf auf einen Knoten weitergeleitet wird, bei dem im enter-nodee event ein neuer Timer erzeugt wird.
The first timer is successfully deleted from the Job-Table after it was done.
This is the part of my process-definition:
<start-state name="startOrder">
| <transition to="waitForAddress"/>
| </start-state>
|
| <state name="waitForAddress">
| <event type="node-enter">
| <create-timer name="waitForAddress" duedate="#{professionalOrdermanagementTimerConfigurator.getWaitForAddress()}" transition="deliveryAddressSet">
| <action name="deadlineReached" expression="#{professionalOrdermanagementProcessController.deliveryAddressSet()}"></action>
| </create-timer>
| </event>
| <event type="node-leave">
| <cancel-timer name="waitForAddress"/>
| <action name="log" expression='#{professionalOrdermanagementProcessmanager.logInfo("leaveWaitForAddress")}'></action>
| </event>
| <transition to="waitForIncomingPayment" name="deliveryAddressSet"></transition>
| <transition to="reversal" name="cancelOrder"></transition>
| </state>
|
| <state name="waitForIncomingPayment">
| <event type="node-enter">
| <action name="log" expression='#{professionalOrdermanagementProcessmanager.logInfo("entering WaitForIncomingPayment...")}'></action>
| <create-timer name="waitForIncomingPayment" duedate="#{professionalOrdermanagementTimerConfigurator.getDueDate()}" transition="paymentOverdue">
| <action name="deadlineReachedNow" expression="#{professionalOrdermanagementPaymentProcesscontroller.deadlineReached()}"></action>
| </create-timer>
| </event>
| <event type="node-leave">
| <cancel-timer name="waitForIncomingPayment"/>
| </event>
| <transition to="orderDone" name="paymentReceived"></transition>
| <transition to="overdue" name="paymentOverdue"></transition>
| <transition to="reversal" name="cancelOrder"></transition>
| </state>
| ...
|
I am using jBPM 3.2.3 Seam 2.1 and JBoss 4.2.2
Does anybody why I get this exception?
Thx Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192182#4192182
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192182
17 years, 4 months
[JBoss jBPM] - Re: variable scope from a script
by tbeernot
"mputz" wrote : /**
| | * sets a variable. If a variable exists in the scope given by the token, that
| | * variable is updated. Otherwise, the variable is created on the root token
| | * (=process instance scope).
| | */
| | public void setVariable(String name, Object value, Token token) {
|
| In order to use setVariable on different tokens, the variables have to be created first with createVariable, otherwise they will all end up being referenced by the root token.
Create variable works indeed. It also works to update an already existing variable. So my problem is solved, thank you!
However, IMHO, I find the behavior strange:
- Even though a token is explicitely provided, setVariable elects to ignore it. Rather throw an exception stating the variable does not exist, but do not ignore that parameter; there is a two-parameter method for a more "agile" behavior.
- createVariable can be used to create and update a variable. However "create" is much more specific about what is going to happen than "set", and I had not expected it to update also.
Personally I find the following behavior more logical:
- createVariable: create only but not update, exception if variable exists
- updateVariable: update only, exception if not exist
- setVariable: create if not exist, otherwise update
Thanks!
Tom
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192129#4192129
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192129
17 years, 4 months
[JBoss jBPM] - Re: variable scope from a script
by mputz
There is a test case that covers this scenario:
http://fisheye.jboss.org/browse/JBPM/jbpm.3/jpdl/jar/src/test/java/org/jb...
Looking at testScopeOverriding(), this works properly if the createVariable(String name, Object value, Token token) is used.
The results are different if setVariable(String name, Object value, Token token) is used, which is also documented in the javadocs:
/**
| * sets a variable. If a variable exists in the scope given by the token, that
| * variable is updated. Otherwise, the variable is created on the root token
| * (=process instance scope).
| */
| public void setVariable(String name, Object value, Token token) {
In order to use setVariable on different tokens, the variables have to be created first with createVariable, otherwise they will all end up being referenced by the root token.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192116#4192116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192116
17 years, 4 months