1 2 Previous Next 16 Replies Latest reply on Feb 6, 2008 4:55 PM by kukeltje

    problem when traversing to end state

    twiceknightly

      Hi,

      First of all I'd just like to say that the jbpm code looks of very high quality and it's a great framework. Hopefully if I get to the point where I understand it sufficiently I may be able to contribute some bug fixes.

      I have a UI that allows shows me task list, allows me to create new tasks and update variables at each stage. I'm using container managed persistence as set up in accordance with

      http://wiki.jboss.org/wiki/Wiki.jsp?page=Jbpm32UsingCMT

      I'm having problems when calling taskInstance.end() on a task which leads to an end state. The persistance seems to be working because new rows in the database are appearing for new task instances etc. However when I take a transition from a penultimate state to an end state I get the stack trace below.

      javax.faces.FacesException: Error calling action method of component with id taskform:transitionButton
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
       at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
       at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
       at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
       at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
       at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
       at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
       at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
       at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
       at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
      Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{taskBean.saveAndClose}
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       ... 18 more
      Caused by: java.lang.ClassCastException: cannot assign instance of org.hibernate.exception.NestableDelegate to field org.hibernate.exception.NestableRuntimeException.delegate of type org.hibernate.exception.NestableDelegate in instance of org.hibernate.SessionException
       at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(Ljava.lang.Object;[Ljava.lang.Object;)V(Unknown Source)
       at java.io.ObjectStreamClass.setObjFieldValues(Ljava.lang.Object;[Ljava.lang.Object;)V(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
       at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
       at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Ljava.io.ObjectStreamClass;)V(Unknown Source)
       at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
       at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
       at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
       at weblogic.rmi.extensions.server.CBVInputStream.readObjectInternal(CBVInputStream.java:71)
       at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:65)
       at weblogic.rmi.internal.ServerRequest.unmarshalThrowable(ServerRequest.java:352)
       at weblogic.rmi.internal.ServerRequest.getThrowable(ServerRequest.java:62)
       at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:203)
       at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:335)
       at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
       at com.nr.tms.workflow.interaction.ejb.TMSWorkflowService_7jxszs_EOImpl_920_WLStub.saveAndCloseTask(JLjava.lang.String;Ljava.util.List;)V(Unknown Source)
       at org.jbpm.webapp.bean.TaskBean.saveAndClose(TaskBean.java:100)
       at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
       at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      


        • 1. Re: problem when traversing to end state
          kukeltje

          Hmmm... transitioning from the 'last but one' ;-) state to the last one should work. I myself have not used CMT (yet), so I have to ask/find someone who did.

          But since there is a classcast exception, could it be that there is more than one hibernate version/jar somewhere in your classpath? Or cglib?

          btw... twiceKnightly? twicenightly would mean something ;-) but keep me from getting a good rest.

          • 2. Re: problem when traversing to end state
            twiceknightly

            I'll check that I don't have any spurious hibernate jars on my classpath. Perhaps it's the usual problem of weblogic having them on the classpath.

            btw do I need to get the EJB timer working for basic functionality?

            twiceknightly is simply my chess handle ... :). I'm married for goodness sake lol.

            • 3. Re: problem when traversing to end state
              twiceknightly

              I have just noticed further up in my logs I am still getting Session is closed!

              It's the same problem as identified in this thread

              http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105609#4105609

              I think the class cast exception is just a side effect of the session being closed.

              Has anyone got this working properly on weblogic 9.2 using CMT?

              • 4. Re: problem when traversing to end state
                kukeltje

                if you can create a minimal ear (which can be used as a test case) I'll try to get it up and running in JBoss to see if that makes a difference). If it is below 10MB you can mail it to ronald (at) jbpm dot borg (-b)

                • 5. Re: problem when traversing to end state
                  twiceknightly

                  Aha I have found the exact same problem in this thread.

                  http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035795#4035795

                  In my stack trace

                  sync=org.jbpm.db.JobSession$DeleteJobsSynchronization@27a68c
                  Session is closed!

                  The only question is how I get around it.

                  So if i'm understanding correctly JobSession clears up tasks the have just ended?

                  The session is closed, transaction commited which causes DeleteJobSynchronization. This fails because of closed session.

                  The question is what can I do about it?

                  • 6. Re: problem when traversing to end state
                    kukeltje

                    well... could be just a bug in jBPM then. Please file a jira issue and well see.

                    But if you can find the real cause so the workaround mentioned in the other topic is not needed any more would be even better :-)

                    • 7. Re: problem when traversing to end state
                      twiceknightly

                      I think this is an important issue and needs to be resolved because it's a fairly common scenario in any type of serious work to use CMT via EJB. Searching the forum it has caught a lot of people trying to do serious development and there isn't any official work around. It seems as if it just doesn't work with CMT out of the box. I'd be interested to see if any of you guys could put together a JBoss minimal app including EJB using CMT.

                      Are others not using transactions? Have people who are using JTA not seen the same issue? Are people just writing webapps and not 3 tier systems?

                      If someone with particular knowledge of what that particular class if for and when it gets called could write a brief description I would certainly have an attempt at finding a workaround. Assuming my company give me some more time to "evaluate" the jbpm :).

                      • 8. Re: problem when traversing to end state
                        twiceknightly

                        Zibi101,

                        Even if you implement this solution does the original JobSession method not get called?

                        Also I don't think you have listed your SpringPersistenceServiceFactory ... Could you do that please and give a fuller explination of how to set up jbpm in Spring. I have some experience in Spring but haven't used the transaction stuff yet (or if I have I have just took it from somewhere ...). This idea of synchronizing things with transactions, is there an equivalent way to do that using CMT normally i.e. without spring?

                        • 9. Re: problem when traversing to end state
                          tom.baeyens

                          i didn't see the process execution problem yet.

                          i do see in the stack trace a deserialization problem of a hibernate object. but i don't see the link with the process execution problem yet.


                          Caused by: java.lang.ClassCastException: cannot assign instance of org.hibernate.exception.NestableDelegate to field org.hibernate.exception.NestableRuntimeException.delegate of type org.hibernate.exception.NestableDelegate in instance of org.hibernate.SessionException
                           at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(Ljava.lang.Object;[Ljava.lang.Object;
                          )V(Unknown Source)
                           ...
                           at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
                           at weblogic.rmi.extensions.server.CBVInputStream.readObjectInternal(CBVInputStream.java:71)
                           ...


                          • 10. Re: problem when traversing to end state
                            twiceknightly

                            Tom,

                            How did you replicate this? Are you trying container managed transactions? Are you not seeing the Session Is Closed Exception in JobSession? In initially I though that this problem may be a symptom of that problem.

                            • 11. Re: problem when traversing to end state
                              twiceknightly

                               

                              "tom.baeyens@jboss.com" wrote:
                              i didn't see the process execution problem yet.


                              It only happens for me on completion of an end state. That's when JobSession gets fired off isn't it? Just before the transaction commits.

                              • 12. Re: problem when traversing to end state
                                kukeltje

                                It also (seams) to happen on cancelling a process according to the other post

                                • 13. Re: problem when traversing to end state
                                  twiceknightly

                                  As an experiment I set the TransactionAttribute on my EJB to NotSupported. Surprizingly it worked without any problems. What really worries me is I have the hibernate config given below tying hibernate into JTA!


                                   <jbpm-context>
                                   <service name="persistence" factory="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory" />
                                   <factory>
                                   <bean class="org.jbpm.persistence.db.DBPersistenceServiceFactory">
                                   <field name="isCurrentSessionEnabled">
                                   <false/>
                                   </field>
                                   <field name="isTransactionEnabled">
                                   <false/>
                                   </field>
                                   </bean>
                                   </factory>
                                   </service>
                                   <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
                                   <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
                                   <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
                                   <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
                                   <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
                                   </jbpm-context>
                                  


                                  • 14. Re: problem when traversing to end state
                                    vijaykoripella

                                    I am also facing the same issue , complete Task doesnt work inside a transaction. if used with out the transaction it works .I have raised a Jira issue for the same,
                                    http://jira.jboss.org/jira/browse/JBPM-1130

                                    1 2 Previous Next