10 Replies Latest reply on May 9, 2006 3:54 PM by John Woodward

    getting Exception when using pageflow in jbpm

    Jin Wang Newbie

      Here is my code:

      @BeginTask( pageflow = "editApplication" )
      public String viewTask()
      {
      application = this.applicationDao.getApplicationById( this.applicationId );
      return "location";
      }

      location is definded in the pageflow. The exception I am getting is like this:

      Caused by: org.hibernate.HibernateException: instance not of expected entity type: org.jbpm.graph.def.Node
      at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3301)
      at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1330)
      at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
      at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:215)
      at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
      at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:221)
      at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:476)
      at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:2803)

      It seems that Seam is trying to persist the page node. This exception does not occur if the pageflow is removed.

      I am using jboss-seam-1.0beta2. Any suggestion is appreciated.

        • 1. Re: getting Exception when using pageflow in jbpm
          Gavin King Master

          Could you please try upgrading to Seam CR2, and see what happens?

          • 2. Re: getting Exception when using pageflow in jbpm
            Jin Wang Newbie

            Got a slightly different exception after upgrade to CR2.
            Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=VALTECHWORK/79, BranchQual=, localId=79] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.TransientObjectException: org.jbpm.graph.def.Node)
            at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:369)
            at org.jboss.tm.TxManager.commit(TxManager.java:239)
            at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
            at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.commit(SeamExtendedManagedPersistencePhaseListener.java:85)
            ... 33 more
            Caused by: org.hibernate.TransientObjectException: org.jbpm.graph.def.Node
            at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:216)
            at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
            at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:221)
            at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:476)
            at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:2900)

            Is there any example available that uses BeginTask and pageflow at the same time? I have been trying to figure this out for two days. We are developing a web application with Seam and scheduled to go production in mid June.

            • 3. Re: getting Exception when using pageflow in jbpm
              Gavin King Master

              I have not tried to do this.

              Please submit a VERY SIMPLE, easily runnable EAR (with sourcecode) to Seam JIRA and I will take a look.

              • 4. Re: getting Exception when using pageflow in jbpm
                Jin Wang Newbie

                Thanks, Gavin. I will do that when I get a chance. Just curious, have you tried to use a pageflow inside a workflow process?

                The other alternative I tried was to beginTask then start pageflow to join the conversation. The pageflow stops working. Another approcach I tried was to start the pageflow first then beginTask. That caused a NullPointerException in PageFlow because the node associated with the pageFlowToken is null. The stack trace is as follows:
                java.lang.NullPointerException
                at org.jboss.seam.core.Pageflow.hasTransition(Pageflow.java:155)
                at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:24)
                at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84)
                at javax.faces.component.UICommand.broadcast(UICommand.java:106)
                at javax.faces.component.UIData.broadcast(UIData.java:338)
                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:316)
                at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)

                It seems that pageflow and workflow do not work well together in Seam. The dvdstore example has both pageflow and workflow but they are not used together on the same pages. Thanks for your suggestions.

                • 5. Re: getting Exception when using pageflow in jbpm
                  Gavin King Master

                  I have never tried, no.

                  • 6. Re: getting Exception when using pageflow in jbpm
                    Jin Wang Newbie

                    Getting an odd exception:

                    org.jbpm.persistence.JbpmPersistenceException: couldn't assign id to org.jbpm.graph.exe.ProcessInstance@1428308
                    at org.jbpm.persistence.db.DbPersistenceService.assignId(DbPersistenceService.java:208)
                    at org.jbpm.svc.Services.assignId(Services.java:235)
                    at org.jbpm.graph.exe.ProcessInstance.(ProcessInstance.java:95)
                    at org.jbpm.graph.def.ProcessDefinition.createProcessInstance(ProcessDefinition.java:125)
                    at org.jboss.seam.core.Pageflow.begin(Pageflow.java:184)
                    at org.jboss.seam.interceptors.ConversationInterceptor.beginNavigation(ConversationInterceptor.java:200)
                    at org.jboss.seam.interceptors.ConversationInterceptor.beginConversation(ConversationInterceptor.java:186)
                    at org.jboss.seam.interceptors.ConversationInterceptor.beginConversationIfNecessary(ConversationInterceptor.java:146)
                    at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:70)
                    at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
                    at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
                    at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
                    at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:60)
                    at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
                    at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
                    at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
                    at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:34)

                    this is caused by
                    org.hibernate.HibernateException: instance not of expected entity type: org.jboss.seam.jbpm.Page is not a: org.jbpm.graph.def.Node
                    at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3412)
                    at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1314)
                    at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
                    at org.hibernate.engine.ForeignKeys$Nullifier.isNullifiable(ForeignKeys.java:137)
                    at org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:69)...

                    I checked seam source code, Page is a subclass of Node. I double-checked that we are using jbpm3.1.1. "org/jbpm/graph/action/action.types.xml" is in the jbpm3.1.1.jar and it does specify Page in it. I tried to reference action.types.xml in jbpm.cfg.xml file according to the comments in Page class. It does not help.

                    Does you have any suggestions? Gavin. Hopefully this extra info could be helpful. I will post a JIRA issue later.

                    • 7. Re: getting Exception when using pageflow in jbpm
                      Gavin King Master

                      Are you sure you aren't configging pageflows as process instances?

                      • 8. Re: getting Exception when using pageflow in jbpm
                        Jin Wang Newbie

                        Yes. I am sure about that. Here is the web.xml definition
                        <context-param>
                        <param-name>org.jboss.seam.core.init.componentClasses</param-name>
                        <param-value>org.jboss.seam.core.Jbpm</param-value>
                        </context-param>

                        <context-param>
                        <param-name>org.jboss.seam.core.jbpm.processDefinitions</param-name>
                        <param-value>applicationManagement.jpdl.xml</param-value>
                        </context-param>


                        <context-param>
                        <param-name>org.jboss.seam.core.jbpm.pageflowDefinitions</param-name>
                        <param-value>editApplication.jpdl.xml</param-value>
                        </context-param>

                        applicationManagement process is started with @CreateProcess( definition = "applicationManagement" ). The page flow is started with @BeginTask(pageflow="editApplication").

                        • 9. Re: getting Exception when using pageflow in jbpm
                          Gavin King Master

                          OK, so like I said, I need test code to reproduce this.

                          • 10. Re: getting Exception when using pageflow in jbpm
                            John Woodward Newbie

                            I've attached to the jira issue http://jira.jboss.com/jira/browse/JBSEAM-136 an ecplise project that should exhibit the problem, built on the "todo list" example.

                            j