1 Reply Latest reply on Mar 19, 2007 11:32 AM by morpheus_jboss

    Exception: Closed JbpmContext in different order

    rafaelle

      Hi,

      I'am testing web application example in jbpm-3.1 package. I downloaded it, deployed, ... it worked, ... I have done some changes (I think they are not big changes), and now, when I push "Save" or "Save and Close" buttons it fails and this is the log:

      
      11:29:19,655 DEBUG [JbpmContext] creating JbpmContext
      11:29:19,655 DEBUG [DbPersistenceServiceFactory] creating persistence service
      11:29:19,655 DEBUG [DbPersistenceService] creating hibernate session
      11:29:19,655 DEBUG [DbPersistenceService] beginning hibernate transaction
      11:29:19,655 DEBUG [JbpmContext] closing JbpmContext
      11:29:19,655 DEBUG [Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@17503eb
      11:29:19,655 DEBUG [DbPersistenceService] committing hibernate transaction
      11:29:19,655 DEBUG [DbPersistenceService] closing hibernate session
      11:29:19,655 DEBUG [Services] closing service 'authentication': org.jbpm.security.authentication.DefaultAuthenticationService@1547277
      11:29:19,655 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
      org.jbpm.JbpmException: closed JbpmContext in different order then they were created... check your try-finally's around JbpmContexts blocks
       at org.jbpm.JbpmContext.popThisContextFromTheStack(JbpmContext.java:503)
       at org.jbpm.JbpmContext.close(JbpmContext.java:140)
       at org.jbpm.web.JbpmContextFilter.doFilter(JbpmContextFilter.java:85)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)
       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:81)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       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:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       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:534)
      11:29:23,077 DEBUG [JbpmContextInfo] creating jbpm context with service factories '[message, scheduler, logging, persistence, authentication]'
      11:29:23,249 DEBUG [StaticNotifier] woke up
      11:29:23,592 DEBUG [JbpmContext] creating JbpmContext
      11:29:27,327 DEBUG [JbpmContextInfo] creating jbpm context with service factories '[message, scheduler, logging, persistence, authentication]'
      11:29:27,327 DEBUG [JbpmContext] creating JbpmContext
      11:29:27,327 DEBUG [DbPersistenceServiceFactory] creating persistence service
      11:29:27,327 DEBUG [DbPersistenceService] creating hibernate session
      11:29:27,327 DEBUG [DbPersistenceService] beginning hibernate transaction
      11:29:27,327 DEBUG [JbpmContext] closing JbpmContext
      11:29:27,327 DEBUG [Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@956f01
      11:29:27,327 DEBUG [DbPersistenceService] committing hibernate transaction
      11:29:27,327 DEBUG [DbPersistenceService] closing hibernate session
      11:29:27,327 DEBUG [Services] closing service 'message': org.jbpm.msg.db.DbMessageService@aabe71
      11:29:27,327 DEBUG [CommandExecutorThread] waiting for more messages
      11:29:27,327 DEBUG [StaticNotifier] going to wait for (CMD_EXECUTOR, java.lang.Object@1c519e2)
      11:29:27,327 DEBUG [DbPersistenceServiceFactory] creating persistence service
      11:29:27,327 DEBUG [DbPersistenceService] creating hibernate session
      11:29:27,327 DEBUG [DbPersistenceService] beginning hibernate transaction
      11:29:27,327 DEBUG [SchedulerThread] checking for timers
      
      


      I have seached again and again ... and I don't find where is the problem. I think something is creating or closing the JbpmContext, but I don't know who is the one.

      In fact, I have put logs into taskbean.java class in saveAndClose() method, but that logs never appears ... so ... If I could find the source code where JbpmContext is closed wrongly, ... I could try to fix it, but I am blinded.

      Anyone had a problem like this and could fix it? I am deperate!!

      Thanks you all, folks!!