8 Replies Latest reply on Jan 16, 2007 3:30 PM by Juan Giovanolli

    Exception on Seam1.1.CR1

    Gus Gu Expert

      Hi Gavin,
      I got an exception listed below when I run Seam1.1 CR1. The codes also are listed. The codes run fine Seam1.0.1GA. I don't know it is my codes problem or not. Thank you in advance.

      public String create() {
       GroupCategory fgc = em.find(GroupCategory.class,new Integer(1));
       instance.setGroupCategory(fgc);
       instance.setGroupAdmin(user);
       em.persist(instance);
       Person member = em.find(Person.class, user.getPersonId());
       GroupMembership gm = new GroupMembership(instance,member);
       gm.setAccepted(true);
       gm.setAccessable(true);
       gm.setJoinedOn(new Date());
       em.persist(gm);
       isNew = false;
      
       groupExplorer.setInstance(instance);
       refreshFinder();
       return "exploregroup";
       }

      2006-11-21 20:32:45,109 ERROR [org.apache.myfaces.lifecycle.PhaseListenerManager] Exception in PhaseListener INVOKE_APPLICATION(5) afterPhase
      java.lang.IllegalStateException: Could not commit transaction
       at org.jboss.seam.jsf.AbstractSeamPhaseListener.commitOrRollback(AbstractSeamPhaseListener.java:312)
       at org.jboss.seam.jsf.TransactionalSeamPhaseListener.handleTransactionsAfterPhase(TransactionalSeamPhaseListener.java:45)
       at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:85)
       at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:345)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.cvn.custom.util.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:132)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=san_gu/106, BranchQual=, localId=106] status=STATUS_NO_TRANSACTION; - nested throwable: (java.lang.IllegalStateException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.cvn.domain.GroupMembership.member -> com.cvn.domain.Person)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
       at org.jboss.tm.TxManager.commit(TxManager.java:240)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
       at org.jboss.seam.jsf.AbstractSeamPhaseListener.commitOrRollback(AbstractSeamPhaseListener.java:301)
       ... 34 more
      Caused by: java.lang.IllegalStateException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.cvn.domain.GroupMembership.member -> com.cvn.domain.Person
       at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:638)
       at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
       ... 37 more
      Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.cvn.domain.GroupMembership.member -> com.cvn.domain.Person
       at org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:353)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:139)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
       ... 40 more


        • 1. Re: Exception on Seam1.1.CR1
          Gavin King Master

          I'm not sure. These kinds of problems are subtle, you'll need to use your debugger. Find out why you have a reference to a transient object in your persistent object graph.

          • 2. Re: Exception on Seam1.1.CR1
            Gus Gu Expert

            Hi Gavin,
            Thank you very much for your quick reply. There was no exception again after I removed transient fields from entity bean. However, it seems that ejb3 allows transient fields in entity bean. Is it ejb3 bug or seam bug, or there are other transient fields addition methods. Thanks for further guidance in advance.

            • 3. Re: Exception on Seam1.1.CR1
              Gavin King Master

              What exactly do you mean by "removed transient fields"?

              • 4. Re: Exception on Seam1.1.CR1
                Gus Gu Expert

                Hi Gavin,
                I commented the @Transient fields in entity beans, then the exceptions disappeared.

                • 5. Re: Exception on Seam1.1.CR1
                  Gavin King Master

                  That makes no sense. I find it really difficult to believe.

                  • 6. Re: Exception on Seam1.1.CR1
                    Gus Gu Expert

                    Hi Gavin,
                    I am very sorry. You are right. It is not the @Transient problem. It is my composite primary key problem, which worked on EJB3 FD8 but failed on FD9. The problem is I only assigned values (groupId and memberId) to GroupMembershipPK class, but did not assigned group and member values to GroupMembership class. It seems FD9 has more restrict on it. Thank you very much and have a good holiday.

                    • 7. Re: Exception on Seam1.1.CR1
                      Gavin King Master

                      No problem, cheers mate.

                      • 8. Re: Exception on Seam1.1.CR1
                        Juan Giovanolli Newbie

                        Hi: i have a similar problem with a jBPM object. i get the exception below:

                        17:18:13,790 INFO [STDOUT] Hibernate: select processdef0_.ID_ as ID1_606_, processdef0_.NAME_ as NAME2_606_, processdef0_.VERSION_ as VERSION3_606_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_606_, processdef0_.STARTSTATE_ as STARTSTATE5_606_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc limit ?
                        17:18:13,790 INFO [STDOUT] Hibernate: insert into JBPM_TOKEN (VERSION_, NAME_, START_, END_, NODEENTER_, NEXTLOGINDEX_, ISABLETOREACTIVATEPARENT_, ISTERMINATIONIMPLICIT_, ISSUSPENDED_, NODE_, PROCESSINSTANCE_, PARENT_, SUBPROCESSINSTANCE_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
                        17:18:13,806 INFO [STDOUT] Hibernate: insert into JBPM_PROCESSINSTANCE (VERSION_, START_, END_, ISSUSPENDED_, PROCESSDEFINITION_, ROOTTOKEN_, SUPERPROCESSTOKEN_) values (?, ?, ?, ?, ?, ?, ?)
                        17:18:13,806 INFO [STDOUT] Hibernate: select definition0_.PROCESSDEFINITION_ as PROCESSD4_1_, definition0_.ID_ as ID1_1_, definition0_.NAME_ as NAME3_1_, definition0_.ID_ as ID1_618_0_, definition0_.NAME_ as NAME3_618_0_, definition0_.PROCESSDEFINITION_ as PROCESSD4_618_0_, definition0_.STARTTASK_ as STARTTASK5_618_0_, definition0_.CLASS_ as CLASS2_618_0_ from JBPM_MODULEDEFINITION definition0_ where definition0_.PROCESSDEFINITION_=?
                        17:18:13,822 INFO [STDOUT] Hibernate: select events0_.PROCESSDEFINITION_ as PROCESSD5_1_, events0_.ID_ as ID1_1_, events0_.EVENTTYPE_ as EVENTTYPE2_1_, events0_.ID_ as ID1_609_0_, events0_.EVENTTYPE_ as EVENTTYPE2_609_0_, events0_.TYPE_ as TYPE3_609_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_609_0_ from JBPM_EVENT events0_ where events0_.PROCESSDEFINITION_=?
                        17:18:13,822 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, CLASS_) values (?, ?, ?, ?, 'I')
                        17:18:13,884 INFO [STDOUT] Hibernate: select node0_.ID_ as ID1_607_0_, node0_.NAME_ as NAME3_607_0_, node0_.PROCESSDEFINITION_ as PROCESSD4_607_0_, node0_.ISASYNC_ as ISASYNC5_607_0_, node0_.ACTION_ as ACTION6_607_0_, node0_.SUPERSTATE_ as SUPERSTATE7_607_0_, node0_.SUBPROCESSDEFINITION_ as SUBPROCE8_607_0_, node0_.DECISIONEXPRESSION_ as DECISION9_607_0_, node0_.DECISIONDELEGATION as DECISIO10_607_0_, node0_.SIGNAL_ as SIGNAL11_607_0_, node0_.CREATETASKS_ as CREATET12_607_0_, node0_.ENDTASKS_ as ENDTASKS13_607_0_, node0_.CLASS_ as CLASS2_607_0_ from JBPM_NODE node0_ where node0_.ID_=?
                        17:18:13,884 INFO [STDOUT] Hibernate: select leavingtra0_.FROM_ as FROM4_1_, leavingtra0_.ID_ as ID1_1_, leavingtra0_.FROMINDEX_ as FROMINDEX6_1_, leavingtra0_.ID_ as ID1_608_0_, leavingtra0_.NAME_ as NAME2_608_0_, leavingtra0_.PROCESSDEFINITION_ as PROCESSD3_608_0_, leavingtra0_.FROM_ as FROM4_608_0_, leavingtra0_.TO_ as TO5_608_0_ from JBPM_TRANSITION leavingtra0_ where leavingtra0_.FROM_=?
                        17:18:13,884 INFO [STDOUT] Hibernate: select events0_.NODE_ as NODE6_1_, events0_.ID_ as ID1_1_, events0_.EVENTTYPE_ as EVENTTYPE2_1_, events0_.ID_ as ID1_609_0_, events0_.EVENTTYPE_ as EVENTTYPE2_609_0_, events0_.TYPE_ as TYPE3_609_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_609_0_ from JBPM_EVENT events0_ where events0_.NODE_=?
                        17:18:13,900 INFO [STDOUT] Hibernate: select events0_.TRANSITION_ as TRANSITION7_1_, events0_.ID_ as ID1_1_, events0_.EVENTTYPE_ as EVENTTYPE2_1_, events0_.ID_ as ID1_609_0_, events0_.EVENTTYPE_ as EVENTTYPE2_609_0_, events0_.TYPE_ as TYPE3_609_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_609_0_ from JBPM_EVENT events0_ where events0_.TRANSITION_=?
                        17:18:13,900 INFO [STDOUT] Hibernate: select node0_.ID_ as ID1_607_0_, node0_.NAME_ as NAME3_607_0_, node0_.PROCESSDEFINITION_ as PROCESSD4_607_0_, node0_.ISASYNC_ as ISASYNC5_607_0_, node0_.ACTION_ as ACTION6_607_0_, node0_.SUPERSTATE_ as SUPERSTATE7_607_0_, node0_.SUBPROCESSDEFINITION_ as SUBPROCE8_607_0_, node0_.DECISIONEXPRESSION_ as DECISION9_607_0_, node0_.DECISIONDELEGATION as DECISIO10_607_0_, node0_.SIGNAL_ as SIGNAL11_607_0_, node0_.CREATETASKS_ as CREATET12_607_0_, node0_.ENDTASKS_ as ENDTASKS13_607_0_, node0_.CLASS_ as CLASS2_607_0_ from JBPM_NODE node0_ where node0_.ID_=?
                        17:18:13,900 INFO [STDOUT] Hibernate: select events0_.NODE_ as NODE6_1_, events0_.ID_ as ID1_1_, events0_.EVENTTYPE_ as EVENTTYPE2_1_, events0_.ID_ as ID1_609_0_, events0_.EVENTTYPE_ as EVENTTYPE2_609_0_, events0_.TYPE_ as TYPE3_609_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_609_0_ from JBPM_EVENT events0_ where events0_.NODE_=?
                        17:18:13,900 INFO [STDOUT] Hibernate: select tasks0_.TASKNODE_ as TASKNODE11_1_, tasks0_.ID_ as ID1_1_, tasks0_.ID_ as ID1_616_0_, tasks0_.NAME_ as NAME2_616_0_, tasks0_.PROCESSDEFINITION_ as PROCESSD3_616_0_, tasks0_.DESCRIPTION_ as DESCRIPT4_616_0_, tasks0_.ISBLOCKING_ as ISBLOCKING5_616_0_, tasks0_.ISSIGNALLING_ as ISSIGNAL6_616_0_, tasks0_.DUEDATE_ as DUEDATE7_616_0_, tasks0_.ACTORIDEXPRESSION_ as ACTORIDE8_616_0_, tasks0_.POOLEDACTORSEXPRESSION_ as POOLEDAC9_616_0_, tasks0_.TASKMGMTDEFINITION_ as TASKMGM10_616_0_, tasks0_.TASKNODE_ as TASKNODE11_616_0_, tasks0_.STARTSTATE_ as STARTSTATE12_616_0_, tasks0_.ASSIGNMENTDELEGATION_ as ASSIGNM13_616_0_, tasks0_.SWIMLANE_ as SWIMLANE14_616_0_, tasks0_.TASKCONTROLLER_ as TASKCON15_616_0_ from JBPM_TASK tasks0_ where tasks0_.TASKNODE_=?
                        17:18:13,900 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
                        17:18:13,915 INFO [STDOUT] Hibernate: insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T')
                        17:18:13,915 INFO [STDOUT] Hibernate: select events0_.TASK_ as TASK8_1_, events0_.ID_ as ID1_1_, events0_.EVENTTYPE_ as EVENTTYPE2_1_, events0_.ID_ as ID1_609_0_, events0_.EVENTTYPE_ as EVENTTYPE2_609_0_, events0_.TYPE_ as TYPE3_609_0_, events0_.GRAPHELEMENT_ as GRAPHELE4_609_0_ from JBPM_EVENT events0_ where events0_.TASK_=?
                        17:18:13,994 INFO [STDOUT] Hibernate: insert into JBPM_VARIABLEINSTANCE (NAME_, CONVERTER_, TOKEN_, TOKENVARIABLEMAP_, PROCESSINSTANCE_, STRINGVALUE_, CLASS_) values (?, ?, ?, ?, ?, ?, 'S')
                        17:18:14,009 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, VARIABLEINSTANCE_, CLASS_) values (?, ?, ?, ?, ?, 'R')
                        17:18:14,009 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, VARIABLEINSTANCE_, OLDSTRINGVALUE_, NEWSTRINGVALUE_, CLASS_) values (?, ?, ?, ?, ?, ?, ?, 'U')
                        17:18:14,009 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, TRANSITION_, CLASS_) values (?, ?, ?, ?, ?, 'S')
                        17:18:14,009 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, TRANSITION_, SOURCENODE_, DESTINATIONNODE_, CLASS_) values (?, ?, ?, ?, ?, ?, ?, 'T')
                        17:18:14,025 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, TASKINSTANCE_, TASKOLDACTORID_, TASKACTORID_, CLASS_) values (?, ?, ?, ?, ?, ?, ?, '2')
                        17:18:14,025 INFO [STDOUT] Hibernate: insert into JBPM_LOG (INDEX_, DATE_, TOKEN_, PARENT_, TASKINSTANCE_, TASKACTORID_, CLASS_) values (?, ?, ?, ?, ?, ?, '1')
                        17:18:14,025 ERROR [PhaseListenerManager] Exception in PhaseListener INVOKE_APPLICATION(5) afterPhase
                        java.lang.IllegalStateException: Could not commit transaction
                         at org.jboss.seam.jsf.AbstractSeamPhaseListener.commitOrRollback(AbstractSeamPhaseListener.java:321)
                         at org.jboss.seam.jsf.TransactionalSeamPhaseListener.handleTransactionsAfterPhase(TransactionalSeamPhaseListener.java:45)
                         at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:85)
                         at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
                         at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:345)
                         at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                         at java.lang.Thread.run(Thread.java:595)
                        Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=santexintel09/53, BranchQual=, localId=53] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.taskmgmt.exe.TaskMgmtInstance)
                         at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
                         at org.jboss.tm.TxManager.commit(TxManager.java:240)
                         at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
                         at org.jboss.seam.jsf.AbstractSeamPhaseListener.commitOrRollback(AbstractSeamPhaseListener.java:310)
                         ... 41 more
                        Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.taskmgmt.exe.TaskMgmtInstance
                         at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
                         at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
                         at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
                         at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:482)
                         at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3056)
                         at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:474)
                         at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197)
                         at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
                         at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
                         at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
                         at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
                         at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
                         at org.jboss.seam.core.ManagedJbpmContext.beforeCompletion(ManagedJbpmContext.java:96)
                         at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
                         at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
                         at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
                         ... 44 more
                        


                        it's seems that when try to persist the processinstance, first should persist the taskmgmtinstance.
                        But, SURPRISE, the problem appears only if i work with a workflow loaded i a programmatic way. this is my workflow:

                         StartState st = new StartState("begin");
                         //SuperState s1 = new SuperState("super1");
                         EndState en = new EndState("end");
                         TaskNode tskn = new TaskNode("tk1");
                        
                         Task tsk = new Task("tarea1");
                         tsk.setTaskNode(tskn);
                         org.jbpm.graph.def.Transition t1 = new org.jbpm.graph.def.Transition("s_to_su");
                         org.jbpm.graph.def.Transition t2 = new org.jbpm.graph.def.Transition("su_to_e");
                        
                         ProcessDefinition pd = new ProcessDefinition("qwer");
                        
                         st.addLeavingTransition(t1);
                         tskn.addArrivingTransition(t1);
                        
                        
                         tskn.addLeavingTransition(t2);
                         en.addArrivingTransition(t2);
                        
                        
                         tsk.setSwimlane(new Swimlane("actorA"));
                        
                         tsk.setActorIdExpression("actorA");
                         tskn.addTask(tsk);
                         //s1.addNode(tskn);
                         st.setProcessDefinition(pd);
                         tskn.setProcessDefinition(pd);
                         en.setProcessDefinition(pd);
                         pd.addNode(st);
                         pd.addNode(tskn);
                         pd.addNode(en);
                        

                        as you can see, this is a very simple workflow, but it doesn´t work.
                        Any ideas??
                        PD: if you need more info, please let me know