0 Replies Latest reply on Feb 15, 2010 6:06 AM by ajanz

    seam/jbpm and session closed error

    ajanz

      i am using seam 2.0.2 SP1

      i try to execute jbpm commands with following code.

        JbpmContext jbpmContext = null;

        try {
         // AJ 11.2.2010 muss jedesmal neu erzeugt werden!!!
         // da n Threads hierauf zugreifen!
        
         jbpmContext = cfg.createJbpmContext();
         if (jbpmContext == null) {
          File f = new File("test.xml");
          log.debug("Path for context " + f.getAbsolutePath());

          jbpmContext = cfg.createJbpmContext();

         }

         if (jbpmContext == null)
          throw new Exception("Error now jbpm context!");
         returnValue = cmd.execute(jbpmContext);

       

        } catch (Exception e) {
         log.error("Error executeCommand",e);
        }
        finally {
         if ( jbpmContext != null  ) {
          jbpmContext.close();
          jbpmContext = null;
         }
        
        
        }

       

      it sometimes works fine.

      but on every cancelprocessesinstance or endprocessinstance command i got later an "session is closed" error.

      when i execute the commands over the commandservicebean everything is ok.