1 2 Previous Next 20 Replies Latest reply on Jan 23, 2009 10:38 AM by John Singleton

    JBoss 5 deployment error

    John Singleton Newbie

      [using JBoss 5.0.0.GA, with jbossws 3.0.4]
      I'm upgrading from 4.2 to 5.0, believe I have made the necessary changes to configuration files etc, but still cannot deploy. My ejb jar contains 4 session beans and one mdb. The server.log seems to show that the ejbs, message queues, etc are deploying correctly, but then shows this

      2008-12-30 12:01:41,515 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
      javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowEngine,service=EJB3 is not registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
       at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
       at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Thread.java:595)
      
      That trace occurs 5 times, once for each bean, followed by 5 reps of
      2008-12-30 12:01:41,516 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowEngine,service=EJB3,VMID=583c10bfdbd326ba:285c21a7:11e88d78742:-7ffa
      
      followed by
      2008-12-30 12:01:41,517 DEBUG [org.jboss.ejb3.deployers.Ejb3Deployer] Error during deploy: vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar
      org.jboss.deployers.spi.DeploymentException: Error deploying workflow-ejb-2.7.0.jar: java.lang.ClassNotFoundException: workflow.ejb.client.WorkflowEngineLocal from BaseClassLoader@14c7deb{VFSClassLoaderPolicy@deeebd{name=vfsfile:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/conf/jboss-service.xml domain=ClassLoaderDomain@6458a6{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.system.NoAnnotationURLClassLoader@1037c71} roots=[MemoryContextHandler@782357[path= context=vfsmemory://3j011-imw1zs-fpct32ww-1-fpct36o5-6 real=vfsmemory://3j011-imw1zs-fpct32ww-1-fpct36o5-6], DelegatingHandler@29291718[path=jbossws-framework.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-framework.jar],
      The ClassNotFoundException line is 55k characters long and contains 104 DelegatingHandlers and an exported list that is 30k characters long. After that dump, it gives these traces/dumps:
      at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:203)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Thread.java:595)
      [[another dump here]]
       at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:282)
       at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:329)
       at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:584)
       at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
       ... 23 more
      [[another dump here]] at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:203)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Thread.java:595)
      [[another dump here]]
       at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:282)
       at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:329)
       at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:584)
       at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
       ... 23 more
      [[another dump here]]
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:385)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:164)
       at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:203)
       ... 28 more
      
      followed by undeploying the ear.

      Clearly something is seriously wrong but the error message doesn't give me enough of a clue. I checked that the "not found" class is indeed in the ejb-jar (it is the local interface of my session bean). I searched the forums for these messages and did not see anything relevant. I have not modified jboss-service.xml from the default. What next?

        • 1. Re: JBoss 5 deployment error
          jaikiran pai Master

           

          java.lang.ClassNotFoundException: workflow.ejb.client.WorkflowEngineLocal


          Which jar contains this class? Is it the workflow-ejb-2.7.0.jar? If yes, post the output of

          jar -tf workflow-ejb-2.7.0.jar


          • 2. Re: JBoss 5 deployment error
            John Singleton Newbie

            Yes, that's the jar.

            $ jar tf workflow-ejb-2.7.0.jar
            META-INF/
            META-INF/MANIFEST.MF
            workflow/
            workflow/ejb/
            workflow/ejb/client/
            workflow/ejb/client/count/
            workflow/ejb/client/model/
            workflow/ejb/server/
            workflow/ejb/server/count/
            workflow/ejb/server/model/
            workflow/ejb/util/
            bootstrap.properties
            META-INF/jboss.xml
            META-INF/persistence.xml
            TC-1025_bpmnxpdl_24.xsd
            workflow/ejb/client/count/Count.class
            workflow/ejb/client/count/CountManagerEndpoint.class
            workflow/ejb/client/count/CountManagerRemote.class
            workflow/ejb/client/EntryParams.class
            workflow/ejb/client/ExecutionDetail$1.class
            workflow/ejb/client/ExecutionDetail.class
            workflow/ejb/client/ExecutionSummary$1.class
            workflow/ejb/client/ExecutionSummary.class
            workflow/ejb/client/model/ModelManagerEndpoint.class
            workflow/ejb/client/model/ModelManagerRemote.class
            workflow/ejb/client/ProcessDefinition.class
            workflow/ejb/client/ProcessDefinitionDigester.class
            workflow/ejb/client/ResultingParams.class
            workflow/ejb/client/StateDefinition$1.class
            workflow/ejb/client/StateDefinition.class
            workflow/ejb/client/StepDefinition$1.class
            workflow/ejb/client/StepDefinition.class
            workflow/ejb/client/TransitionDefinition$1.class
            workflow/ejb/client/TransitionDefinition.class
            workflow/ejb/client/TransitionReference$1.class
            workflow/ejb/client/TransitionReference.class
            workflow/ejb/client/WorkflowEngineLocal.class
            workflow/ejb/client/WorkflowManagerEndpoint.class
            workflow/ejb/client/WorkflowManagerRemote.class
            workflow/ejb/client/WorkflowPackage.class
            workflow/ejb/client/WorkflowParameter.class
            workflow/ejb/server/count/CountManager.class
            workflow/ejb/server/LongRunningAlgorithm.class
            workflow/ejb/server/model/ModelManager.class
            workflow/ejb/server/WorkflowEngine.class
            workflow/ejb/server/WorkflowManager.class
            workflow/ejb/server/WorkflowMDB.class
            workflow/ejb/server/WorkflowUtil.class
            workflow/ejb/util/ActivityDigester.class
            workflow/ejb/util/AlgorithmHandler.class
            workflow/ejb/util/ApplicationException.class
            workflow/ejb/util/ParamUtil.class
            workflow/ejb/util/TransitionDigester.class
            workflow/ejb/util/TransRefDigester.class
            workflow/ejb/util/TransRestrictionDigester.class
            workflow/ejb/util/XPDLUtil.class
            META-INF/ejb-jar.xml
            META-INF/maven/
            META-INF/maven/blackbook-workflow/
            META-INF/maven/blackbook-workflow/workflow-ejb/
            META-INF/maven/blackbook-workflow/workflow-ejb/pom.xml
            META-INF/maven/blackbook-workflow/workflow-ejb/pom.properties
            


            • 3. Re: JBoss 5 deployment error
              John Singleton Newbie

              and here are the contents of the three META-INF config files.

              ejb-jar.xml:

              <?xml version="1.0" encoding="UTF-8"?>
              
              <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
               http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
               version="3.0">
              </ejb-jar>
              


              jboss.xml:
              <?xml version="1.0" encoding="UTF-8"?>
              <jboss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.jboss.org/j2ee/schema
               http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
               version="5.0">
               <security-domain>cert</security-domain>
               <enterprise-beans>
               <session>
               <ejb-name>WorkflowManager</ejb-name>
               <port-component>
               <auth-method>CLIENT-CERT</auth-method>
               <transport-guarantee>CONFIDENTIAL</transport-guarantee>
               </port-component>
               </session>
               <message-driven>
               <ejb-name>WorkflowMDB</ejb-name>
               </message-driven>
               <session>
               <ejb-name>CountManager</ejb-name>
               <port-component>
               <auth-method>CLIENT-CERT</auth-method>
               <transport-guarantee>CONFIDENTIAL</transport-guarantee>
               </port-component>
               </session>
               <session>
               <ejb-name>ModelManager</ejb-name>
               <port-component>
               <auth-method>CLIENT-CERT</auth-method>
               <transport-guarantee>CONFIDENTIAL</transport-guarantee>
               </port-component>
               </session>
               </enterprise-beans>
              </jboss>
              


              persistence.xml:
              <persistence xmlns="http://java.sun.com/xml/ns/persistence"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
               http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
               version="1.0">
               <persistence-unit name="workflow">
               <provider>org.hibernate.ejb.HibernatePersistence</provider>
               <jta-data-source>java:/jdbc/workflow</jta-data-source>
               <properties>
               <property name="hibernate.dialect"
               value="org.hibernate.dialect.MySQLInnoDBDialect" />
               </properties>
               </persistence-unit>
              </persistence>
              


              • 4. Re: JBoss 5 deployment error
                jaikiran pai Master

                 

                2008-12-30 12:01:41,517 DEBUG [org.jboss.ejb3.deployers.Ejb3Deployer] Error during deploy: vfszip:/h
                ome/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar
                org.jboss.deployers.spi.DeploymentException: Error deploying workflow-ejb-2.7.0.jar: java.lang.ClassNotFoundException: workflow.ejb.client.WorkflowEngineLocal

                Looks strange for a couple of reasons:

                1) The ClassNotFoundException is being logged at DEBUG level

                2) Your jar -tf output does show that the workflow.ejb.client.WorkflowEngineLocal class is contained in the jar file

                workflow/ejb/client/TransitionReference.class
                workflow/ejb/client/WorkflowEngineLocal.class
                workflow/ejb/client/WorkflowManagerEndpoint.class
                workflow/ejb/client/WorkflowManagerRemote.class


                Can you show us the contents of your application.xml? How is this jar mapped in the application.xml?

                Please also post the code of the bean and its interfaces including the import statement in those classes. And in your first post you have removed some of the details from the exception stacktrace. Could you please post the entire exception stacktrace?


                • 5. Re: JBoss 5 deployment error
                  John Singleton Newbie

                  Here is my application.xml (which is auto-generated by our maven build)

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE application PUBLIC
                   "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
                   "http://java.sun.com/dtd/application_1_3.dtd">
                  <application>
                   <display-name>workflow-ear</display-name>
                   <description>Contract for Consumers of Blackbook Components, defining and
                   centralizing the dependency management contract</description>
                   <module>
                   <ejb>workflow-ejb-2.7.0.jar</ejb>
                   </module>
                   <module>
                   <ejb>usermgmt-ejb-2.7.0.jar</ejb>
                   </module>
                   <module>
                   <web>
                   <web-uri>usermgmt-war-2.7.0.war</web-uri>
                   <context-root>usermgmt</context-root>
                   </web>
                   </module>
                   <module>
                   <web>
                   <web-uri>workflow-war-2.7.0.war</web-uri>
                   <context-root>workflow</context-root>
                   </web>
                   </module>
                  </application>
                  

                  And here is the jboss-app.xml
                  <jboss-app>
                  
                   <loader-repository >
                   dot.com:loader=workflow.ear
                   <loader-repository-config>
                   java2ParentDelegaton=true
                   </loader-repository-config>
                   </loader-repository>
                  
                  </jboss-app>
                  

                  Here is the WorkflowEngine bean class
                  package workflow.ejb.server;
                  
                  import java.io.Serializable;
                  import java.lang.reflect.Method;
                  import java.util.ArrayList;
                  import java.util.Date;
                  import java.util.HashMap;
                  import java.util.List;
                  import java.util.Map;
                  
                  import javax.annotation.security.RolesAllowed;
                  import javax.ejb.Stateless;
                  import javax.ejb.TransactionAttribute;
                  import javax.ejb.TransactionAttributeType;
                  import javax.ejb.TransactionManagement;
                  import javax.ejb.TransactionManagementType;
                  import javax.persistence.EntityManager;
                  import javax.persistence.PersistenceContext;
                  import javax.persistence.Query;
                  
                  import org.apache.commons.logging.Log;
                  import org.apache.commons.logging.LogFactory;
                  import org.jboss.ejb3.annotation.LocalBinding;
                  
                  import security.ejb.client.User;
                  import workflow.ejb.client.ExecutionDetail;
                  import workflow.ejb.client.ExecutionSummary;
                  import workflow.ejb.client.ResultingParams;
                  import workflow.ejb.client.StateDefinition;
                  import workflow.ejb.client.StepDefinition;
                  import workflow.ejb.client.TransitionDefinition;
                  import workflow.ejb.client.TransitionReference;
                  import workflow.ejb.client.WorkflowEngineLocal;
                  import workflow.ejb.util.ParamUtil;
                  import workflow.ejb.util.XPDLUtil;
                  
                  /**
                   * Processes workflow. Uses Declaritive Transaction Mgmt for individual methods.
                   */
                  @Stateless
                  @RolesAllowed( { "UNCLASSIFIED" })
                  @LocalBinding(jndiBinding = "workflow/WorkflowEngine/local")
                  @TransactionManagement(value = TransactionManagementType.CONTAINER)
                  public class WorkflowEngine implements Serializable, WorkflowEngineLocal {
                  
                   /**
                   * The class logger
                   */
                   private static Log logger = LogFactory.getLog(WorkflowEngine.class);
                  
                   /** workflow engine */
                   @javax.annotation.Resource(mappedName = "workflow/WorkflowEngine/local")
                   private WorkflowEngineLocal workflowEngineLocal;
                  
                   /**
                   * The entity manager
                   */
                   protected @PersistenceContext(unitName = "workflow")
                   EntityManager em;
                  
                   /**
                   * Sets the execution summary id of the execution detail.
                   *
                   * @param executionSummaryId
                   * @param executionDetailCopy
                   */
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public void addExecutionDetailToExecutionSummary(long executionSummaryId,
                   ExecutionDetail executionDetailCopy) {
                  
                   Query updateComplete = em
                   .createNativeQuery("update EXECUTION_DETAIL set EX_SUMMARY_ID = :first where ID = :second");
                  
                   updateComplete.setParameter("first", executionSummaryId);
                   updateComplete.setParameter("second", executionDetailCopy.getId());
                   updateComplete.executeUpdate();
                   }
                  
                   /**
                   * Make sure that all transition definitions for a join have an associated
                   * execution detail meaning that the join can proceed.
                   *
                   * @param tdList
                   * @param esId
                   * @return boolean
                   */
                   @SuppressWarnings("unchecked")
                   public boolean areAllJoinTransitionsFinished(
                   List<TransitionDefinition> tdList, long esId) {
                  
                   if (tdList == null) {
                   logger.error("No transitions found for fork in execution summary: "
                   + esId);
                   return false;
                   }
                  
                   for (TransitionDefinition td : tdList) {
                  
                   Query query = em
                   .createQuery("from ExecutionDetail e "
                   + " WHERE e.associatedStepId =:first AND e.executionSummaryId =:second AND e.completed =:third");
                  
                   query.setParameter("first", td.getId());
                   query.setParameter("second", esId);
                   query.setParameter("third", Long.parseLong("1"));
                  
                   List<ExecutionDetail> edList = query.getResultList();
                   long edSize = edList.size();
                  
                   if (edSize < 1) {
                   return false;
                   }
                   }
                   return true;
                   }
                  
                   /**
                   * Checks if an execution detail exists for an execution summary and step
                   * definition id.
                   *
                   * @param executionSummaryId
                   * @param stepDefinitionId
                   * @return int
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public int checkIfExecutionDetailExists(long executionSummaryId,
                   long stepDefinitionId) {
                   Query lockQuery = em
                   .createNativeQuery("SELECT ID FROM EXECUTION_DETAIL WHERE EX_SUMMARY_ID = :first AND STEP_ID= :second ");
                  
                   lockQuery.setParameter("first", executionSummaryId);
                   lockQuery.setParameter("second", stepDefinitionId);
                  
                   List results = lockQuery.getResultList();
                   int noUpdate = 0;
                   if (results != null && results.size() != 0) {
                   noUpdate = 1;
                   }
                  
                   return noUpdate;
                   }
                  
                   /**
                   * Creates a result params entry for an execution detail and execution
                   * summary. This method does not insert the LOB, PARAMS_AS_XML.
                   *
                   * @param executionSummaryId
                   * @param executionDetailId
                   * @return int - number inserted
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public int createResultParams(long executionSummaryId,
                   long executionDetailId) {
                  
                   // adding execution ids to entry and result param tables.
                   Query insertRPQuery = em
                   .createNativeQuery("INSERT INTO RESULTING_PARAMS(EX_DETAIL_ID,EX_SUMMARY_ID) "
                   + " VALUES (:first,:second)");
                   insertRPQuery.setParameter("first", executionDetailId);
                   insertRPQuery.setParameter("second", executionSummaryId);
                   int noInsert = insertRPQuery.executeUpdate();
                  
                   return noInsert;
                   }
                  
                   /**
                   * Get previous steps' execution params add the definition params.
                   *
                   * @param eSummaryId
                   * @param edId
                   * @param stateDef
                   * @return params
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public Map<String, Object> getDefinitionParams(long eSummaryId, long edId,
                   StateDefinition stateDef) {
                  
                   // get previous steps' execution params
                   Map<String, Object> params = new HashMap<String, Object>();
                  
                   // add the definition params.
                   params.putAll(stateDef.getParams());
                  
                   return params;
                   }
                  
                   /**
                   * Get Execution Detail based on execution summary and step definition. This
                   * method is highly nested.
                   *
                   * @param executionSummaryId
                   * The id of an ExecutionSummary
                   * @param stepDefinitionId
                   * The id of a StepDefinition
                   * @return ExecutionDetail the execution detail for the associated
                   * ExecutionSummary and StepDefinition.
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public ExecutionDetail getExecutionDetail(long executionSummaryId,
                   long stepDefinitionId) {
                  
                   int noUpdate = workflowEngineLocal.checkIfExecutionDetailExists(
                   executionSummaryId, stepDefinitionId);
                  
                   if (noUpdate == 0) {
                   workflowEngineLocal.insertExecutionDetail(executionSummaryId,
                   stepDefinitionId);
                   }
                  
                   Query query = em
                   .createQuery("from ExecutionDetail e WHERE e.executionSummaryId =:first AND e.associatedStepId =:second");
                  
                   // get execution detail of previous step.
                   query.setParameter("first", executionSummaryId);
                   query.setParameter("second", stepDefinitionId);
                  
                   // long edqtime = System.currentTimeMillis();
                   List<ExecutionDetail> edList = query.getResultList();
                  
                   ExecutionDetail eDetail = null;
                   // Add in the results in order.
                   for (ExecutionDetail executionDetailFromQuery : edList) {
                   eDetail = executionDetailFromQuery;
                   }
                  
                   // adding execution ids to entry and result param tables.
                   if (noUpdate == 0) {
                   workflowEngineLocal.createResultParams(executionSummaryId, eDetail
                   .getId());
                   }
                  
                   return eDetail;
                   }
                  
                   /**
                   * Get the next TransitionDefinition for a fromState.
                   *
                   * @param stateDefId
                   * @return TransitionDefinition
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public TransitionDefinition getNextTransitionDefinition(long stateDefId) {
                   Query query = em
                   .createQuery("from TransitionDefinition t WHERE t.fromState.id =:first ");
                   query.setParameter("first", stateDefId);
                  
                   List<TransitionDefinition> edList = query.getResultList();
                  
                   TransitionDefinition td = null;
                   if (edList != null && edList.size() > 0) {
                   td = edList.get(0);
                   }
                  
                   return td;
                   }
                  
                   /**
                   * Gets the resulting params for an execution detail.
                   *
                   * @param edId
                   *
                   * @param stepDefinition
                   * a step definition
                   * @param esId
                   * Execution summary id
                   * @return Map containing parameters
                   */
                  
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public Map<String, Object> getPersistedParams(long edId, long esId) {
                  
                   Query query = em
                   .createQuery(
                   "from ResultingParams rp WHERE rp.exSummaryId =:first AND rp.exDetailId =:second")
                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                  
                   // get execution detail of previous step.
                   query.setParameter("first", esId);
                  
                   query.setParameter("second", edId);
                  
                   List<ResultingParams> resultParamList = query.getResultList();
                   Map<String, Object> params = new HashMap<String, Object>();
                  
                   if (resultParamList != null) {
                   // Add in the results in order.
                   for (ResultingParams resultParam : resultParamList) {
                   params.putAll(ParamUtil.paramsAsXML(resultParam
                   .getResultingParamsAsXML(), true));
                   }
                   }
                  
                   return params;
                   }
                  
                   /**
                   * Gets the params from the previous transition definition.
                   *
                   * @param eSummaryId
                   * @param stateDef
                   * @return runtimeParams
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public Map<String, Object> getRuntimeParams(long eSummaryId,
                   StateDefinition stateDef) {
                   Map<String, Object> runtimeParams = new HashMap<String, Object>();
                  
                   List<TransitionDefinition> transitionDefinitionList = workflowEngineLocal
                   .getTransitionDefinitionsWithToId(stateDef.getId());
                   for (TransitionDefinition td : transitionDefinitionList) {
                  
                   ExecutionDetail prevED = workflowEngineLocal.getExecutionDetail(
                   eSummaryId, td.getFromState().getId());
                   runtimeParams.putAll(workflowEngineLocal.getPersistedParams(prevED
                   .getId(), eSummaryId));
                   }
                  
                   return runtimeParams;
                   }
                  
                   /**
                   * Get TransitionDefinitions for a transitionReference id.
                   *
                   * @param transitionReferenceId
                   * @return List of TransitionDefinitionS
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public List<TransitionDefinition> getTransitionDefinitions(
                   long transitionReferenceId) {
                  
                   Query fetchTQuery = em
                   .createQuery(
                   "from TransitionDefinition td WHERE td.transitionReference.id =:first")
                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                   fetchTQuery.setParameter("first", transitionReferenceId);
                   List<TransitionDefinition> transitionDefinitionList = fetchTQuery
                   .getResultList();
                   if (transitionDefinitionList != null) {
                  
                   }
                   return transitionDefinitionList;
                   }
                  
                   /**
                   * Get TransitionDefinitions for a toState id.
                   *
                   * @param toStateDefId
                   * @return List of TransitionDefinitionS
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public List<TransitionDefinition> getTransitionDefinitionsWithToId(
                   long toStateDefId) {
                  
                   Query fetchTQuery = em.createQuery(
                   "from TransitionDefinition td WHERE td.toState.id =:first")
                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                   fetchTQuery.setParameter("first", toStateDefId);
                  
                   List<TransitionDefinition> tdList = new ArrayList<TransitionDefinition>();
                   try {
                  
                   List<TransitionDefinition> tempTdList = fetchTQuery.getResultList();
                   if (tempTdList != null && tempTdList.size() > 0) {
                   tdList = getTransitionDefinitions(tempTdList.get(0)
                   .getTransitionReference().getId());
                   }
                   } catch (javax.persistence.NoResultException e) {
                   logger.error("No transition defs found with " + toStateDefId
                   + " as a 'To' state.", e);
                   }
                  
                   return tdList;
                   }
                  
                   /**
                   * Handle action for a state definition.
                   *
                   * @param stateDefinition
                   * a state Definition
                   * @param definitionParams
                   * @param runtimeParams
                   * @param params
                   * The state parameters
                   * @param user
                   * a User
                   * @return a Map<String, Object> the results of a action class method
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public Map<String, Object> handleAction(StateDefinition stateDefinition,
                   Map<String, Object> definitionParams,
                   Map<String, Object> runtimeParams, User user) {
                   Map<String, Object> retmap = null;
                   try {
                  
                   definitionParams.put("user", user);
                  
                   Class c = Class.forName(stateDefinition.getActionClass());
                   Class[] argClasses = new Class[3];
                   argClasses[0] = StateDefinition.class;
                   argClasses[1] = Map.class;
                   argClasses[2] = Map.class;
                   Method mymethod = c.getMethod(stateDefinition.getActionMethod(),
                   argClasses);
                   Object[] args = new Object[3];
                   args[0] = stateDefinition;
                   args[1] = definitionParams;
                   args[2] = runtimeParams;
                   Object obj = c.newInstance();
                   retmap = (Map<String, Object>) mymethod.invoke(obj, args);
                   } catch (Exception e) {
                   logger.error("An error occured while running an algorithm", e);
                   throw new RuntimeException(
                   "An error occured while running an algorithm");
                   }
                   return retmap;
                   }
                  
                   /**
                   * Create execution detail.
                   *
                   * @param executionSummaryId
                   * @param stepDefinitionId
                   * @return number inserted
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public int insertExecutionDetail(long executionSummaryId,
                   long stepDefinitionId) {
                  
                   Query insertQuery = em
                   .createNativeQuery("INSERT INTO EXECUTION_DETAIL(EX_SUMMARY_ID, STEP_ID) "
                   + " VALUES (:first, :second)");
                  
                   insertQuery.setParameter("first", executionSummaryId);
                   insertQuery.setParameter("second", stepDefinitionId);
                   int noInsert = insertQuery.executeUpdate();
                   return noInsert;
                   }
                  
                   /**
                   * Send message to queue.
                   *
                   * @param eSummaryId
                   * @param tdId
                   * @param user
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void postMessageForNextStep(long eSummaryId, long tdId, User user) {
                   WorkflowUtil.sendMessage(WorkflowManager.queueName, tdId, user,
                   eSummaryId);
                   }
                  
                   /**
                   * Get the ExecutionDetail,StepDefinition,ExecutionSummary and process the
                   * next step.
                   *
                   * @param eSummaryId
                   * @param stepDefId
                   * @param user
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void process(long eSummaryId, long stepDefId, User user) {
                  
                   // get objects by their id.
                   ExecutionDetail executionDetail = workflowEngineLocal
                   .getExecutionDetail(eSummaryId, stepDefId);
                   StepDefinition stepDefinition = em
                   .find(StepDefinition.class, stepDefId);
                   ExecutionSummary executionSummary = em.find(ExecutionSummary.class,
                   eSummaryId);
                  
                   // if all needed objects were found, process this step
                   if (executionSummary != null
                   && executionSummary.getWhenCompleted() == null
                   && stepDefinition != null) {
                   workflowEngineLocal.processStep(executionSummary, stepDefinition,
                   executionDetail, user);
                   }
                   }
                  
                   /**
                   * Process a FORK step.
                   *
                   * @param eDetail
                   * @param tDef
                   * @param tRef
                   * @param eSummaryId
                   * @param user
                   */
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void processFork(ExecutionDetail eDetail, TransitionDefinition tDef,
                   TransitionReference tRef, long eSummaryId, User user) {
                  
                   // place all transitions into queue. Since each will get called
                   // do the same thing as a
                   // series. We just don't have a condition.
                   eDetail.setActionClassCalled("FORK");
                  
                   List<TransitionDefinition> transitionDefinitionList = workflowEngineLocal
                   .getTransitionDefinitions(tRef.getId());
                  
                   for (TransitionDefinition td : transitionDefinitionList) {
                  
                   workflowEngineLocal.setExecutionDetailCompleted(eDetail);
                  
                   workflowEngineLocal.postMessageForNextStep(eSummaryId, td
                   .getToState().getId(), user);
                  
                   }
                  
                   }
                  
                   /**
                   * Process a JOIN step.
                   *
                   * @param eDetail
                   * @param tDef
                   * @param tRef
                   * @param eSummaryId
                   * @param user
                   */
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public void processJoin(ExecutionDetail eDetail, TransitionDefinition tDef,
                   TransitionReference tRef, long eSummaryId, User user) {
                  
                   List<TransitionDefinition> transitionDefinitionList = workflowEngineLocal
                   .getTransitionDefinitions(tRef.getId());
                  
                   workflowEngineLocal.setExecutionDetailCompleted(eDetail);
                  
                   if (workflowEngineLocal.areAllJoinTransitionsFinished(
                   transitionDefinitionList, eSummaryId)) {
                   workflowEngineLocal.postMessageForNextStep(eSummaryId, tDef
                   .getToState().getId(), user);
                   }
                  
                   }
                  
                   /**
                   *
                   * @see workflow.ejb.client.WorkflowEngineLocal#processLoop(long,
                   * workflow.ejb.client.ExecutionDetail,
                   * workflow.ejb.client.StateDefinition, security.ejb.client.User)
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void processLoop(long eSummaryId, ExecutionDetail eDetail,
                   StateDefinition stateDef, User user) {
                   String interval = Long.toString(stateDef.getLoopInterval());
                   if (!interval.contains(".")) {
                   interval = interval + ".0";
                   }
                  
                   try {
                   if (stateDef.getWhenToTest().equalsIgnoreCase("before")) {
                  
                   for (; stateDef.getLoopCounter() < stateDef.getLoopMaximum(); stateDef
                   .setLoopCounter(stateDef.getLoopCounter() + 1)) {
                   processStateAlgorithm(eSummaryId, eDetail.getId(),
                   stateDef, user);
                   Thread.sleep(stateDef.getLoopInterval());
                   }
                   }
                   // whenToTest is assumed to be "after"
                   else {
                  
                   do {
                   processStateAlgorithm(eSummaryId, eDetail.getId(),
                   stateDef, user);
                   stateDef.setLoopCounter(stateDef.getLoopCounter() + 1);
                   Thread.sleep(stateDef.getLoopInterval());
                   } while (stateDef.getLoopCounter() < stateDef.getLoopMaximum());
                   }
                   } catch (InterruptedException e) {
                   logger.error("Interruption exception received. ", e);
                   }
                  
                   }
                  
                   /**
                   * Process a SERIES.
                   *
                   * @param eSummaryId
                   * @param tDef
                   * @param eDetail
                   * @param user
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void processSeries(long eSummaryId, TransitionDefinition tDef,
                   ExecutionDetail eDetail, User user) {
                  
                   ExecutionDetail prevED = workflowEngineLocal.getExecutionDetail(
                   eSummaryId, tDef.getFromState().getId());
                   Map<String, Object> params = workflowEngineLocal.getPersistedParams(
                   prevED.getId(), eSummaryId);
                  
                   // evaluate condition to move to next state.
                   boolean res = tDef.getConditionForEval() == null ? true : XPDLUtil
                   .evaluateCondition(tDef.getConditionForEval(), params);
                   if (res) {
                   // move to the next state.
                   eDetail = workflowEngineLocal.getExecutionDetail(eSummaryId, tDef
                   .getId());
                  
                   workflowEngineLocal.setExecutionDetailCompleted(eDetail);
                  
                   workflowEngineLocal.postMessageForNextStep(eSummaryId, tDef
                   .getToState().getId(), user);
                   }
                   }
                  
                   /**
                   * Runs the algorithm.
                   *
                   * @param eSummary
                   * @param stateDef
                   * @param eDetail
                   * @param user
                   * @param em
                   */
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public void processStateDefinition(ExecutionSummary eSummary,
                   StateDefinition stateDef, ExecutionDetail eDetail, User user) {
                  
                   try {
                   boolean hasLoop = (stateDef.getLoopMaximum() > 0);
                  
                   if (hasLoop) {
                   processLoop(eSummary.getId(), eDetail, stateDef, user);
                   } else {
                   processStateAlgorithm(eSummary.getId(), eDetail.getId(),
                   stateDef, user);
                   }
                  
                   TransitionDefinition td = workflowEngineLocal
                   .getNextTransitionDefinition(stateDef.getId());
                  
                   // finished state processing
                   workflowEngineLocal.setExecutionDetailCompleted(eDetail);
                  
                   if (td != null) {
                   // follow next transition
                   workflowEngineLocal.postMessageForNextStep(eSummary.getId(), td
                   .getId(), user);
                   return;
                   } else {
                   workflowEngineLocal.endWorkflow(eSummary);
                   }
                   } catch (Exception e) {
                   workflowEngineLocal.endWorkflowInError(eSummary, eDetail);
                   logger.debug(e.toString());
                   }
                   }
                  
                   /**
                   *
                   * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflow(workflow.ejb.client.ExecutionSummary)
                   */
                   public void endWorkflow(ExecutionSummary eSummary) {
                   // end workflow
                   Date completed = new Date();
                  
                   eSummary.setWhenCompleted(completed);
                  
                   Query updateComplete = em
                   .createNativeQuery("update EXECUTION_SUMMARY set WHEN_COMPLETED = :first where ID = :second");
                  
                   updateComplete.setParameter("first", completed);
                   updateComplete.setParameter("second", eSummary.getId());
                   updateComplete.executeUpdate();
                   }
                  
                   /**
                   *
                   * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflowInError(workflow.ejb.client.ExecutionSummary,
                   * workflow.ejb.client.ExecutionDetail)
                   */
                   public void endWorkflowInError(ExecutionSummary eSummary,
                   ExecutionDetail eDetail) {
                   workflowEngineLocal.setExecutionDetailCompleted(eDetail);
                   workflowEngineLocal.endWorkflow(eSummary);
                   }
                  
                   /**
                   * Process the state algorithm
                   *
                   * @param eSummaryId
                   * Summary ID
                   * @param eDetailId
                   * Detail ID
                   * @param stateDef
                   * State definition
                   * @param user
                   * User
                   */
                   private void processStateAlgorithm(long eSummaryId, long eDetailId,
                   StateDefinition stateDef, User user) {
                   // get params needed to process step
                   Map<String, Object> defParams = workflowEngineLocal
                   .getDefinitionParams(eSummaryId, eDetailId, stateDef);
                  
                   Map<String, Object> runtimeParams = new HashMap<String, Object>();
                  
                   List<TransitionDefinition> transitionDefinitionList = workflowEngineLocal
                   .getTransitionDefinitionsWithToId(stateDef.getId());
                   for (TransitionDefinition td : transitionDefinitionList) {
                  
                   ExecutionDetail prevED = workflowEngineLocal.getExecutionDetail(
                   eSummaryId, td.getFromState().getId());
                   runtimeParams.putAll(workflowEngineLocal.getPersistedParams(prevED
                   .getId(), eSummaryId));
                   }
                  
                   // run the algorithm
                   if (stateDef.getActionClass() != null
                   && stateDef.getActionClass().length() > 0) {
                   Map<String, Object> resultMap = workflowEngineLocal.handleAction(
                   stateDef, defParams, runtimeParams, user);
                  
                   workflowEngineLocal.updatePersistedResultParams(eDetailId,
                   eSummaryId, resultMap);
                   } else // must be a fork or join state
                   {
                   workflowEngineLocal.updatePersistedResultParams(eDetailId,
                   eSummaryId, runtimeParams);
                   }
                   }
                  
                   /**
                   * Process step.
                   *
                   * @param executionSummary
                   * an ExecutionSummary
                   * @param stepDefinition
                   * a StateDefinition
                   * @param executionDetail
                   * an executionDetail
                   * @param user
                   * a User
                   * @param params
                   */
                  
                   @SuppressWarnings("unchecked")
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void processStep(ExecutionSummary executionSummary,
                   StepDefinition stepDefinition, ExecutionDetail executionDetail,
                   User user) {
                  
                   if (stepDefinition instanceof StateDefinition) {
                   StateDefinition stateDef = (StateDefinition) stepDefinition;
                   workflowEngineLocal.processStateDefinition(executionSummary,
                   stateDef, executionDetail, user);
                   } else if (stepDefinition instanceof TransitionDefinition) {
                   workflowEngineLocal.processTransitionDefinition(executionSummary,
                   (TransitionDefinition) stepDefinition, executionDetail,
                   user);
                   } else {
                   logger.error("Cannot understand what to process for step with id="
                   + stepDefinition.getId());
                   throw new RuntimeException(
                   "Cannot understand what to process for step with id="
                   + stepDefinition.getId());
                   }
                   workflowEngineLocal.addExecutionDetailToExecutionSummary(
                   executionSummary.getId(), executionDetail);
                   }
                  
                   /**
                   * Process a TransitionDefinition.
                   *
                   * @param eSummary
                   * @param tDef
                   * @param eDetail
                   * @param user
                   */
                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                   public void processTransitionDefinition(ExecutionSummary eSummary,
                   TransitionDefinition tDef, ExecutionDetail eDetail, User user) {
                  
                   TransitionReference tRef = tDef.getTransitionReference();
                  
                   if (tRef.getTransitionType() == TransitionReference.FORK) {
                   workflowEngineLocal.processFork(eDetail, tDef, tRef, eSummary
                   .getId(), user);
                   } else if (tRef.getTransitionType() == TransitionReference.JOIN) {
                   workflowEngineLocal.processJoin(eDetail, tDef, tRef, eSummary
                   .getId(), user);
                   } else if (tRef.getTransitionType() == TransitionReference.SERIES) {
                   workflowEngineLocal.processSeries(eSummary.getId(), tDef, eDetail,
                   user);
                  
                   } else {
                   logger.error("Transition type " + tRef.getTransitionType()
                   + "is not understood.");
                   throw new RuntimeException("Transition type "
                   + tRef.getTransitionType() + "is not understood.");
                   }
                   }
                  
                   /**
                   * Sets an ExecutionDetail as completed.
                   *
                   * @param eDetail
                   * @return number updated
                   */
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public int setExecutionDetailCompleted(ExecutionDetail eDetail) {
                  
                   Query completed = em
                   .createNativeQuery("UPDATE EXECUTION_DETAIL SET COMPLETED = '1' WHERE ID = :first");
                   completed.setParameter("first", eDetail.getId());
                   int numUpdated = completed.executeUpdate();
                   eDetail.setCompleted(1);
                  
                   return numUpdated;
                   }
                  
                   /**
                   * Updates the LOB, PARAMS_AS_XML.
                   *
                   * @param edId
                   * @param esId
                   * @param params
                   */
                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                   public void updatePersistedResultParams(long edId, long esId,
                   Map<String, Object> params) {
                  
                   Query updateResultParamsQuery = em
                   .createNativeQuery("UPDATE RESULTING_PARAMS SET RESULTING_PARAMS_AS_XML = :first WHERE EX_DETAIL_ID = :second");
                  
                   updateResultParamsQuery.setParameter("first", ParamUtil.paramsFromMap(
                   params, true));
                   updateResultParamsQuery.setParameter("second", edId);
                   updateResultParamsQuery.executeUpdate();
                   }
                  }
                  

                  And here is the WorkflowEngineLocal interface
                  package workflow.ejb.client;
                  
                  import java.util.List;
                  import java.util.Map;
                  
                  import javax.ejb.Local;
                  import security.ejb.client.User;
                  
                  /**
                   * The local interface to the Workflow Engine
                   */
                  @Local
                  public interface WorkflowEngineLocal {
                  
                   /**
                   * Sets the execution summary id of the execution detail.
                   *
                   * @param executionSummaryId
                   * @param executionDetailCopy
                   */
                   public void addExecutionDetailToExecutionSummary(long executionSummaryId,
                   ExecutionDetail executionDetailCopy);
                  
                   /**
                   * Make sure that all transition definitions for a join have an associated
                   * execution detail meaning that the join can proceed.
                   *
                   * @param tdList
                   * @param esId
                   * @return boolean
                   */
                   public boolean areAllJoinTransitionsFinished(
                   List<TransitionDefinition> tdList, long esId);
                  
                   /**
                   * Checks if an execution detail exists for an execution summary and step
                   * definition id.
                   *
                   * @param executionSummaryId
                   * @param stepDefinitionId
                   * @return int
                   */
                   public int checkIfExecutionDetailExists(long executionSummaryId,
                   long stepDefinitionId);
                  
                   /**
                   * Creates a result params entry for an execution detail and execution
                   * summary. This method does not insert the LOB, PARAMS_AS_XML.
                   *
                   * @param executionSummaryId
                   * @param executionDetailId
                   * @return int - number inserted
                   */
                   public int createResultParams(long executionSummaryId,
                   long executionDetailId);
                  
                   /**
                   * Get previous steps' execution params add the definition params.
                   *
                   * @param eSummaryId
                   * @param edId
                   * @param stateDef
                   * @return params
                   */
                   public Map<String, Object> getDefinitionParams(long eSummaryId, long edId,
                   StateDefinition stateDef);
                  
                   /**
                   * Get Execution Detail based on execution summary and step definition. This
                   * method is highly nested.
                   *
                   * @param executionSummaryId
                   * The id of an ExecutionSummary
                   * @param stepDefinitionId
                   * The id of a StepDefinition
                   * @return ExecutionDetail the execution detail for the associated
                   * ExecutionSummary and StepDefinition.
                   */
                   public ExecutionDetail getExecutionDetail(long executionSummaryId,
                   long stepDefinitionId);
                  
                   /**
                   * Get the next TransitionDefinition for a fromState.
                   *
                   * @param stateDefId
                   * @return TransitionDefinition
                   */
                   public TransitionDefinition getNextTransitionDefinition(long stateDefId);
                  
                   /**
                   * Gets the resulting params for an execution detail.
                   *
                   * @param edId
                   *
                   * @param stepDefinition
                   * a step definition
                   * @param esId
                   * Execution summary id
                   * @return Map containing parameters
                   */
                   public Map<String, Object> getPersistedParams(long edId, long esId);
                  
                   /**
                   * Gets the params from the previous transition definition.
                   *
                   * @param eSummaryId
                   * @param stateDef
                   * @return runtimeParams
                   */
                   public Map<String, Object> getRuntimeParams(long eSummaryId,
                   StateDefinition stateDef);
                  
                   /**
                   * Get TransitionDefinitions for a transitionReference id.
                   *
                   * @param transitionReferenceId
                   * @return List of TransitionDefinitionS
                   */
                   public List<TransitionDefinition> getTransitionDefinitions(
                   long transitionReferenceId);
                  
                   /**
                   * Get TransitionDefinitions for a toState id.
                   *
                   * @param toStateDefId
                   * @return List of TransitionDefinitionS
                   */
                   public List<TransitionDefinition> getTransitionDefinitionsWithToId(
                   long toStateDefId);
                  
                   /**
                   * Handle action for a state definition.
                   *
                   * @param stateDefinition
                   * a state Definition
                   * @param definitionParams
                   * @param runtimeParams
                   * @param params
                   * The state parameters
                   * @param user
                   * a User
                   * @return a Map<String, Object> the results of a action class method
                   */
                   public Map<String, Object> handleAction(StateDefinition stateDefinition,
                   Map<String, Object> definitionParams,
                   Map<String, Object> runtimeParams, User user);
                  
                   /**
                   * Create execution detail.
                   *
                   * @param executionSummaryId
                   * @param stepDefinitionId
                   * @return number inserted
                   */
                   public int insertExecutionDetail(long executionSummaryId,
                   long stepDefinitionId);
                  
                   /**
                   * Send message to queue.
                   *
                   * @param eSummaryId
                   * @param tdId
                   * @param user
                   */
                   public void postMessageForNextStep(long eSummaryId, long tdId, User user);
                  
                   /**
                   * Get the ExecutionDetail,StepDefinition,ExecutionSummary and process the
                   * next step.
                   *
                   * @param eSummaryId
                   * @param stepDefId
                   * @param user
                   */
                   public void process(long eSummaryId, long stepDefId, User user);
                  
                   /**
                   * Process a FORK step.
                   *
                   * @param eDetail
                   * @param tDef
                   * @param tRef
                   * @param eSummaryId
                   * @param user
                   */
                   public void processFork(ExecutionDetail eDetail, TransitionDefinition tDef,
                   TransitionReference tRef, long eSummaryId, User user);
                  
                   /**
                   * Process a JOIN step.
                   *
                   * @param eDetail
                   * @param tDef
                   * @param tRef
                   * @param eSummaryId
                   * @param user
                   */
                   public void processJoin(ExecutionDetail eDetail, TransitionDefinition tDef,
                   TransitionReference tRef, long eSummaryId, User user);
                  
                   /**
                   * Process a LOOP.
                   *
                   */
                   public void processLoop(long eSummaryId, ExecutionDetail eDetail,
                   StateDefinition stateDef, User user);
                  
                   /**
                   * Process a SERIES.
                   *
                   * @param eSummaryId
                   * @param tDef
                   * @param eDetail
                   * @param user
                   */
                   public void processSeries(long eSummaryId, TransitionDefinition tDef,
                   ExecutionDetail eDetail, User user);
                  
                   /**
                   * Runs the algorithm.
                   *
                   * @param eSummary
                   * @param stateDef
                   * @param eDetail
                   * @param user
                   * @param em
                   */
                   public void processStateDefinition(ExecutionSummary eSummary,
                   StateDefinition stateDef, ExecutionDetail eDetail, User user);
                  
                   /**
                   * Process step.
                   *
                   * @param executionSummary
                   * an ExecutionSummary
                   * @param stepDefinition
                   * a StateDefinition
                   * @param executionDetail
                   * an executionDetail
                   * @param user
                   * a User
                   * @param params
                   */
                  
                   @SuppressWarnings("unchecked")
                   public void processStep(ExecutionSummary executionSummary,
                   StepDefinition stepDefinition, ExecutionDetail executionDetail,
                   User user);
                  
                   /**
                   * Process a TransitionDefinition.
                   *
                   * @param eSummary
                   * @param tDef
                   * @param eDetail
                   * @param user
                   */
                   public void processTransitionDefinition(ExecutionSummary eSummary,
                   TransitionDefinition tDef, ExecutionDetail eDetail, User user);
                  
                   /**
                   * Sets an ExecutionDetail as completed.
                   *
                   * @param eDetail
                   * @return number updated
                   */
                   public int setExecutionDetailCompleted(ExecutionDetail eDetail);
                  
                   /**
                   * Updates the LOB, PARAMS_AS_XML.
                   *
                   * @param edId
                   * @param esId
                   * @param params
                   */
                   public void updatePersistedResultParams(long edId, long esId,
                   Map<String, Object> params);
                  
                  
                   public void endWorkflow(ExecutionSummary eSummary);
                  
                  
                   public void endWorkflowInError(ExecutionSummary eSummary, ExecutionDetail eDetail);
                  
                  }
                  

                  And finally, here is the complete stack trace, with a couple of additional lines for context.
                  2008-12-26 16:46:01,811 DEBUG [org.jboss.ejb3.Ejb3Deployment] EJB3 deployment time took: 2065
                  2008-12-26 16:46:01,815 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
                  javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowEngine,service=EJB3 is not registered.
                   at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                   at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
                   at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
                   at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:613)
                  2008-12-26 16:46:01,815 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
                  javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowMDB,service=EJB3 is not registered.
                   at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                   at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
                   at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
                   at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:613)
                  2008-12-26 16:46:01,816 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
                  javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowManager,service=EJB3 is not registered.
                   at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                   at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
                   at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
                   at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:613)
                  2008-12-26 16:46:01,816 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
                  javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=CountManager,service=EJB3 is not registered.
                   at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                   at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
                   at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
                   at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:613)
                  2008-12-26 16:46:01,816 DEBUG [org.jboss.ejb3.Ejb3Deployment] error trying to stop ejb container
                  javax.management.InstanceNotFoundException: jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=ModelManager,service=EJB3 is not registered.
                   at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                   at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
                   at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:554)
                   at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:538)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
                   at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
                   at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:613)
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowEngine,service=EJB3,VMID=871ba2ae9678192d:-3cd08c6d:11e75424f45:-7ffa
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowMDB,service=EJB3,VMID=871ba2ae9678192d:-3cd08c6d:11e75424f45:-7ffa
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=WorkflowManager,service=EJB3,VMID=871ba2ae9678192d:-3cd08c6d:11e75424f45:-7ffa
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=CountManager,service=EJB3,VMID=871ba2ae9678192d:-3cd08c6d:11e75424f45:-7ffa
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.Ejb3Registry] Unregistered container jboss.j2ee:ear=workflow.ear,jar=workflow-ejb-2.7.0.jar,name=ModelManager,service=EJB3,VMID=871ba2ae9678192d:-3cd08c6d:11e75424f45:-7ffa
                  2008-12-26 16:46:01,817 DEBUG [org.jboss.ejb3.deployers.Ejb3Deployer] Error during deploy: vfszip:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar
                  org.jboss.deployers.spi.DeploymentException: Error deploying workflow-ejb-2.7.0.jar: java.lang.ClassNotFoundException: workflow.ejb.client.WorkflowEngineLocal from BaseClassLoader@7d8dfe{VFSClassLoaderPolicy@f55e8c{name=vfsfile:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/conf/jboss-service.xml domain=ClassLoaderDomain@8de742{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.system.NoAnnotationURLClassLoader@72ffb} roots=[MemoryContextHandler@1197338[path= context=vfsmemory://5c4o13-qr0cl1-fp7dh6nm-1-fp7dharu-6 real=vfsmemory://5c4o13-qr0cl1-fp7dh6nm-1-fp7dharu-6], DelegatingHandler@7787114[path=authorization-plugins-2.7.0.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/authorization-plugins-2.7.0.jar], DelegatingHandler@15740258[path=jboss-jaas-2.7.0.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jboss-jaas-2.7.0.jar], DelegatingHandler@3390197[path=jbossws-common.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-common.jar], DelegatingHandler@3628074[path=jbossws-framework.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-framework.jar], DelegatingHandler@8649932[path=jbossws-native-jaxrpc.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-native-jaxrpc.jar], DelegatingHandler@4844995[path=jbossws-native-jaxws-ext.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-native-jaxws-ext.jar], DelegatingHandler@10005300[path=jbossws-native-jaxws.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-native-jaxws.jar], DelegatingHandler@1043573[path=jbossws-native-saaj.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-native-saaj.jar], DelegatingHandler@7153960[path=jbossws-spi.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/jbossws-spi.jar], DelegatingHandler@11091676[path=mysql-connector-java-5.0.5.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/server/default/lib/mysql-connector-java-5.0.5.jar], DelegatingHandler@6160834[path=antlr.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/antlr.jar], DelegatingHandler@12939382[path=autonumber-plugin.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/autonumber-plugin.jar], DelegatingHandler@5926148[path=bcel.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/bcel.jar], DelegatingHandler@11223709[path=bsf.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/bsf.jar], DelegatingHandler@10652468[path=bsh.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/bsh.jar], DelegatingHandler@6373973[path=commons-collections.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/commons-collections.jar], DelegatingHandler@4854281[path=commons-httpclient.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/commons-httpclient.jar], DelegatingHandler@15089874[path=commons-logging.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/commons-logging.jar], DelegatingHandler@11128116[path=dtdparser121.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/dtdparser121.jar], DelegatingHandler@14629845[path=ejb3-persistence.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ejb3-persistence.jar], DelegatingHandler@13710852[path=el-api.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/el-api.jar], DelegatingHandler@3229880[path=hibernate-annotations.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-annotations.jar], DelegatingHandler@10314131[path=hibernate-commons-annotations.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-commons-annotations.jar], DelegatingHandler@7410782[path=hibernate-core.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-core.jar], DelegatingHandler@15743097[path=hibernate-entitymanager.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-entitymanager.jar], DelegatingHandler@758654[path=hibernate-jmx.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-jmx.jar], DelegatingHandler@14280[path=hibernate-validator.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hibernate-validator.jar], DelegatingHandler@5130683[path=hsqldb-plugin.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hsqldb-plugin.jar], DelegatingHandler@13277641[path=hsqldb.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/hsqldb.jar], DelegatingHandler@3570778[path=jaxen.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jaxen.jar], DelegatingHandler@1971201[path=jboss-bindingservice.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-bindingservice.jar], DelegatingHandler@11752414[path=jboss-common-jdbc-wrapper.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-common-jdbc-wrapper.jar], DelegatingHandler@4659535[path=jboss-current-invocation-aspects.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-current-invocation-aspects.jar], DelegatingHandler@13538103[path=jboss-ejb3-cache.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-cache.jar], DelegatingHandler@2300137[path=jboss-ejb3-common.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-common.jar], DelegatingHandler@3706629[path=jboss-ejb3-core.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-core.jar], DelegatingHandler@3519815[path=jboss-ejb3-deployers.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-deployers.jar], DelegatingHandler@1072762[path=jboss-ejb3-ext-api-impl.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-ext-api-impl.jar], DelegatingHandler@11191856[path=jboss-ejb3-ext-api.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-ext-api.jar], DelegatingHandler@12166727[path=jboss-ejb3-interceptors.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-interceptors.jar], DelegatingHandler@5473751[path=jboss-ejb3-metadata.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-metadata.jar], DelegatingHandler@7872477[path=jboss-ejb3-proxy-clustered.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-proxy-clustered.jar], DelegatingHandler@7611775[path=jboss-ejb3-proxy.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-proxy.jar], DelegatingHandler@4831928[path=jboss-ejb3-security.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/jboss-ejb3-security.jar], DelegatingHandler@8503987[path=jboss-ejb3-transactions.jar context=file:/Users/johnsingleton/Programming/pkg/jboss-5.0.0.GA/common/lib/ real=file:/Users/john


                  • 6. Re: JBoss 5 deployment error
                    John Singleton Newbie

                    Sorry about the truncation of the stack trace. When I used "Preview" on my posting, it looked OK, but when I submitted it, the trace was truncated. If you need to see more, please tell me how I can submit it. The file containing the trace is about 448k in size.

                    • 7. Re: JBoss 5 deployment error
                      jaikiran pai Master

                      The application.xml looks correct. However, the classnotfoundexception stacktrace, which even lists the jar files where the class is looked for, does not show any reference to your jar files (or is it truncated while posting?)

                      In your jboss-app.xml, i see that you are using

                      java2ParentDelegaton=true


                      This property, changes the order in which the jar files are looked for while loading a class (parent-first). Can you try changing it to parent-last:

                      java2ParentDelegaton=false


                      However, i would be a bit surprised if this change works :-)


                      • 8. Re: JBoss 5 deployment error
                        John Singleton Newbie

                        No, the stacktrace does not show a reference to workflow-ejb.jar, even in the un-truncated version.

                        I tried changing the java2ParentDelegation property to false and, as expected, that did not work. I also tried removing that tag completely and that did not work either.

                        I tried deploying my ear, starting JBoss, and bringing up the JMX console. I clicked on jboss.deployment, then scrolled down to the SubDeployment "vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar" and observed the following values:

                        State: ERROR
                        
                        ClassLoaderName: Null
                        
                        Classpath: [DelegatingHandler@13887859[path=workflow.ear/workflow-ejb-2.7.0.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar], DelegatingHandler@7751710[path=workflow.ear/commons-lang-2.1.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-lang-2.1.jar], DelegatingHandler@24692097[path=workflow.ear/commons-logging-1.1.0.jboss.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-logging-1.1.0.jboss.jar], DelegatingHandler@22029867[path=workflow.ear/commons-beanutils-1.7.0.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-beanutils-1.7.0.jar], DelegatingHandler@16375304[path=workflow.ear/commons-codec-1.3.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-codec-1.3.jar], DelegatingHandler@6295272[path=workflow.ear/commons-collections-3.1.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-collections-3.1.jar], DelegatingHandler@7515608[path=workflow.ear/commons-digester-1.7.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/commons-digester-1.7.jar], DelegatingHandler@8619693[path=workflow.ear/jena-2.5.6.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/jena-2.5.6.jar], DelegatingHandler@16700263[path=workflow.ear/arq-2.3.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/arq-2.3.jar], DelegatingHandler@32053749[path=workflow.ear/iri-0.5.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/iri-0.5.jar], DelegatingHandler@10967064[path=workflow.ear/icu4j-3.4.4.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/icu4j-3.4.4.jar], DelegatingHandler@8955272[path=workflow.ear/antlr-2.7.6-brew.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/antlr-2.7.6-brew.jar], DelegatingHandler@19639558[path=workflow.ear/concurrent-jena-1.3.2.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/concurrent-jena-1.3.2.jar], DelegatingHandler@7111491[path=workflow.ear/xercesImpl-2.9.1.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/xercesImpl-2.9.1.jar], DelegatingHandler@1948811[path=workflow.ear/xmlParserAPIs-2.0.2.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/xmlParserAPIs-2.0.2.jar], DelegatingHandler@4545587[path=workflow.ear/json-jena-1.0.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/json-jena-1.0.jar], DelegatingHandler@27797189[path=workflow.ear/xpdl-2.0-alpha1.jar context=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/ real=file:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/xpdl-2.0-alpha1.jar]]
                        
                        DependencyInfo:
                        AbstractDependencyInfo@156c062{idependOn=[AbstractDependencyItem@1ebd825{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@bb9f91{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@1e9029c{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@aa6e7e{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@13c3256{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@10cc039{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}] unresolved=[AbstractDependencyItem@1ebd825{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@bb9f91{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@1e9029c{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@aa6e7e{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@13c3256{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}, AbstractDependencyItem@10cc039{name=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar dependsOn=interface javax.transaction.TransactionManager whenRequired=Real dependentState=Installed resolved=true}]}
                        
                        Scope:
                        [JVM=THIS, APPLICATION=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear, DEPLOYMENT=vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar]
                        

                        Note in particular that workflow-ejb-2.7.0.jar appears to be the first element on the classpath. Does this output provide any clues?

                        • 9. Re: JBoss 5 deployment error
                          jaikiran pai Master

                          I went back and reread the logs and your bean:


                          [[another dump here]]
                          at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:385)
                          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
                          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
                          at java.lang.Class.forName0(Native Method)
                          at java.lang.Class.forName(Class.java:164)
                          at org.jboss.injection.ResourceHandler.loadXmlResourceEnvRefs(ResourceHandler.java:203)


                          1) The code which you posted, shows self-injection:

                          @LocalBinding(jndiBinding = "workflow/WorkflowEngine/local")
                          public class WorkflowEngine implements Serializable, WorkflowEngineLocal {
                          
                          ...
                           /** workflow engine */
                           @javax.annotation.Resource(mappedName = "workflow/WorkflowEngine/local")
                           private WorkflowEngineLocal workflowEngineLocal;
                          


                          I am not saying, it won't work, but was this intentional?

                          2)

                          /** workflow engine */
                          @javax.annotation.Resource(mappedName = "workflow/WorkflowEngine/local")
                          private WorkflowEngineLocal workflowEngineLocal;


                          Instead of injecting the bean with a @Resource, try injecting it with a @EJB.

                          • 10. Re: JBoss 5 deployment error
                            jaikiran pai Master

                             

                            "jaikiran" wrote:


                            1) The code which you posted, shows self-injection:


                            I am not saying, it won't work



                            I now have to say, self injection won't work in the current version. See this https://jira.jboss.org/jira/browse/EJBTHREE-1603

                            • 11. Re: JBoss 5 deployment error
                              John Singleton Newbie

                               

                              Instead of injecting the bean with a @Resource, try injecting it with a @EJB.
                              Tried that with no improvement.
                              I now have to say, self injection won't work in the current version.
                              I spoke with the developer and they couldn't recall why they did this, it was probably a relic of some earlier refactoring. So we took out all the local injections and just made them into local method calls. Deployment still fails with the same error.

                              I tried changing logging to TRACE on org.jboss.deployers and saw a bunch of "not relevant" messages including this:
                              2009-01-06 16:41:25,417 TRACE [org.jboss.deployers.plugins.deployers.DeployersImpl] Deployer org.jboss.deployment.EjbClassLoaderDeployer@eafe8d not relevant for vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-ejb-2.7.0.jar
                              2009-01-06 16:41:25,417 TRACE [org.jboss.deployers.plugins.deployers.DeployersImpl] Deployer org.jboss.deployment.EjbClassLoaderDeployer@eafe8d not relevant for vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-ejb-2.7.0.jar
                              2009-01-06 16:41:25,417 TRACE [org.jboss.deployers.plugins.deployers.DeployersImpl] Deployer org.jboss.deployment.EjbClassLoaderDeployer@eafe8d not relevant for vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/workflow-war-2.7.0.war
                              2009-01-06 16:41:25,417 TRACE [org.jboss.deployers.plugins.deployers.DeployersImpl] Deployer org.jboss.deployment.EjbClassLoaderDeployer@eafe8d not relevant for vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear/usermgmt-war-2.7.0.war
                              2009-01-06 16:41:25,417 TRACE [org.jboss.deployers.plugins.deployers.DeployersImpl] Deployer org.jboss.deployment.EjbClassLoaderDeployer@eafe8d not relevant for vfszip:/home/jhsingl/pkg/jboss-5.0.0.GA/server/default/deploy/workflow.ear
                              
                              What (if anything) is this telling me?

                              • 12. Re: JBoss 5 deployment error
                                jaikiran pai Master

                                 

                                "jhsingle" wrote:
                                So we took out all the local injections and just made them into local method calls. Deployment still fails with the same error.



                                I would not expect the same error after you removed the injection. Do other beans have a similar injection going on? Please post the new logs. The logs might be too long as you have reported in your earlier post, so if you can upload it to some place accessible, then that would help us get the entire logs.

                                If uploading is not possible, then i would mainly be interested in seeing the last few bunch of exception stacktrace on the console/server.log

                                • 13. Re: JBoss 5 deployment error
                                  John Singleton Newbie

                                  I have posted a zip of the entire log at
                                  http://rabasrv.jhuapl.edu/server.log.zip
                                  The zip file is about 1 Meg and unzips to about 14 Meg. The first ClassNotFoundException occurs on line 31730.

                                  There was one other bean with self-injection and I had changed that one also before my last post. Just to be sure, here's the code for WorkflowEngine with the self-injection removed:

                                  package workflow.ejb.server;
                                  
                                  import java.io.Serializable;
                                  import java.lang.reflect.Method;
                                  import java.util.ArrayList;
                                  import java.util.Date;
                                  import java.util.HashMap;
                                  import java.util.List;
                                  import java.util.Map;
                                  
                                  import javax.annotation.security.RolesAllowed;
                                  import javax.ejb.Local;
                                  import javax.ejb.Stateless;
                                  import javax.ejb.TransactionAttribute;
                                  import javax.ejb.TransactionAttributeType;
                                  import javax.ejb.TransactionManagement;
                                  import javax.ejb.TransactionManagementType;
                                  import javax.persistence.EntityManager;
                                  import javax.persistence.PersistenceContext;
                                  import javax.persistence.Query;
                                  
                                  import org.apache.commons.logging.Log;
                                  import org.apache.commons.logging.LogFactory;
                                  import org.jboss.ejb3.annotation.LocalBinding;
                                  
                                  import security.ejb.client.User;
                                  import workflow.ejb.client.ExecutionDetail;
                                  import workflow.ejb.client.ExecutionSummary;
                                  import workflow.ejb.client.ResultingParams;
                                  import workflow.ejb.client.StateDefinition;
                                  import workflow.ejb.client.StepDefinition;
                                  import workflow.ejb.client.TransitionDefinition;
                                  import workflow.ejb.client.TransitionReference;
                                  import workflow.ejb.client.WorkflowEngineLocal;
                                  import workflow.ejb.util.ParamUtil;
                                  import workflow.ejb.util.XPDLUtil;
                                  
                                  /**
                                   * Processes workflow. Uses Declaritive Transaction Mgmt for individual methods.
                                   */
                                  @Stateless
                                  @RolesAllowed( { "UNCLASSIFIED" })
                                  @LocalBinding(jndiBinding = "workflow/WorkflowEngine/local")
                                  @TransactionManagement(value = TransactionManagementType.CONTAINER)
                                  public class WorkflowEngine implements Serializable, WorkflowEngineLocal {
                                  
                                   /**
                                   * The class logger
                                   */
                                   private static Log logger = LogFactory.getLog(WorkflowEngine.class);
                                  
                                   /** workflow engine */
                                  // @javax.annotation.Resource(mappedName = "workflow/WorkflowEngine/local")
                                  // private WorkflowEngineLocal workflowEngineLocal;
                                  
                                   /**
                                   * The entity manager
                                   */
                                   protected @PersistenceContext(unitName = "workflow")
                                   EntityManager em;
                                  
                                   /**
                                   * Sets the execution summary id of the execution detail.
                                   *
                                   * @param executionSummaryId
                                   * @param executionDetailCopy
                                   */
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public void addExecutionDetailToExecutionSummary(long executionSummaryId,
                                   ExecutionDetail executionDetailCopy) {
                                  
                                   Query updateComplete = em
                                   .createNativeQuery("update EXECUTION_DETAIL set EX_SUMMARY_ID = :first where ID = :second");
                                  
                                   updateComplete.setParameter("first", executionSummaryId);
                                   updateComplete.setParameter("second", executionDetailCopy.getId());
                                   updateComplete.executeUpdate();
                                   }
                                  
                                   /**
                                   * Make sure that all transition definitions for a join have an associated
                                   * execution detail meaning that the join can proceed.
                                   *
                                   * @param tdList
                                   * @param esId
                                   * @return boolean
                                   */
                                   @SuppressWarnings("unchecked")
                                   public boolean areAllJoinTransitionsFinished(
                                   List<TransitionDefinition> tdList, long esId) {
                                  
                                   if (tdList == null) {
                                   logger.error("No transitions found for fork in execution summary: "
                                   + esId);
                                   return false;
                                   }
                                  
                                   for (TransitionDefinition td : tdList) {
                                  
                                   Query query = em
                                   .createQuery("from ExecutionDetail e "
                                   + " WHERE e.associatedStepId =:first AND e.executionSummaryId =:second AND e.completed =:third");
                                  
                                   query.setParameter("first", td.getId());
                                   query.setParameter("second", esId);
                                   query.setParameter("third", Long.parseLong("1"));
                                  
                                   List<ExecutionDetail> edList = query.getResultList();
                                   long edSize = edList.size();
                                  
                                   if (edSize < 1) {
                                   return false;
                                   }
                                   }
                                   return true;
                                   }
                                  
                                   /**
                                   * Checks if an execution detail exists for an execution summary and step
                                   * definition id.
                                   *
                                   * @param executionSummaryId
                                   * @param stepDefinitionId
                                   * @return int
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public int checkIfExecutionDetailExists(long executionSummaryId,
                                   long stepDefinitionId) {
                                   Query lockQuery = em
                                   .createNativeQuery("SELECT ID FROM EXECUTION_DETAIL WHERE EX_SUMMARY_ID = :first AND STEP_ID= :second ");
                                  
                                   lockQuery.setParameter("first", executionSummaryId);
                                   lockQuery.setParameter("second", stepDefinitionId);
                                  
                                   List results = lockQuery.getResultList();
                                   int noUpdate = 0;
                                   if (results != null && results.size() != 0) {
                                   noUpdate = 1;
                                   }
                                  
                                   return noUpdate;
                                   }
                                  
                                   /**
                                   * Creates a result params entry for an execution detail and execution
                                   * summary. This method does not insert the LOB, PARAMS_AS_XML.
                                   *
                                   * @param executionSummaryId
                                   * @param executionDetailId
                                   * @return int - number inserted
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public int createResultParams(long executionSummaryId,
                                   long executionDetailId) {
                                  
                                   // adding execution ids to entry and result param tables.
                                   Query insertRPQuery = em
                                   .createNativeQuery("INSERT INTO RESULTING_PARAMS(EX_DETAIL_ID,EX_SUMMARY_ID) "
                                   + " VALUES (:first,:second)");
                                   insertRPQuery.setParameter("first", executionDetailId);
                                   insertRPQuery.setParameter("second", executionSummaryId);
                                   int noInsert = insertRPQuery.executeUpdate();
                                  
                                   return noInsert;
                                   }
                                  
                                   /**
                                   * Get previous steps' execution params add the definition params.
                                   *
                                   * @param eSummaryId
                                   * @param edId
                                   * @param stateDef
                                   * @return params
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public Map<String, Object> getDefinitionParams(long eSummaryId, long edId,
                                   StateDefinition stateDef) {
                                  
                                   // get previous steps' execution params
                                   Map<String, Object> params = new HashMap<String, Object>();
                                  
                                   // add the definition params.
                                   params.putAll(stateDef.getParams());
                                  
                                   return params;
                                   }
                                  
                                   /**
                                   * Get Execution Detail based on execution summary and step definition. This
                                   * method is highly nested.
                                   *
                                   * @param executionSummaryId
                                   * The id of an ExecutionSummary
                                   * @param stepDefinitionId
                                   * The id of a StepDefinition
                                   * @return ExecutionDetail the execution detail for the associated
                                   * ExecutionSummary and StepDefinition.
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public ExecutionDetail getExecutionDetail(long executionSummaryId,
                                   long stepDefinitionId) {
                                  
                                   int noUpdate = checkIfExecutionDetailExists(
                                   executionSummaryId, stepDefinitionId);
                                  
                                   if (noUpdate == 0) {
                                   insertExecutionDetail(executionSummaryId,
                                   stepDefinitionId);
                                   }
                                  
                                   Query query = em
                                   .createQuery("from ExecutionDetail e WHERE e.executionSummaryId =:first AND e.associatedStepId =:second");
                                  
                                   // get execution detail of previous step.
                                   query.setParameter("first", executionSummaryId);
                                   query.setParameter("second", stepDefinitionId);
                                  
                                   // long edqtime = System.currentTimeMillis();
                                   List<ExecutionDetail> edList = query.getResultList();
                                  
                                   ExecutionDetail eDetail = null;
                                   // Add in the results in order.
                                   for (ExecutionDetail executionDetailFromQuery : edList) {
                                   eDetail = executionDetailFromQuery;
                                   }
                                  
                                   // adding execution ids to entry and result param tables.
                                   if (noUpdate == 0) {
                                   createResultParams(executionSummaryId, eDetail
                                   .getId());
                                   }
                                  
                                   return eDetail;
                                   }
                                  
                                   /**
                                   * Get the next TransitionDefinition for a fromState.
                                   *
                                   * @param stateDefId
                                   * @return TransitionDefinition
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public TransitionDefinition getNextTransitionDefinition(long stateDefId) {
                                   Query query = em
                                   .createQuery("from TransitionDefinition t WHERE t.fromState.id =:first ");
                                   query.setParameter("first", stateDefId);
                                  
                                   List<TransitionDefinition> edList = query.getResultList();
                                  
                                   TransitionDefinition td = null;
                                   if (edList != null && edList.size() > 0) {
                                   td = edList.get(0);
                                   }
                                  
                                   return td;
                                   }
                                  
                                   /**
                                   * Gets the resulting params for an execution detail.
                                   *
                                   * @param edId
                                   *
                                   * @param stepDefinition
                                   * a step definition
                                   * @param esId
                                   * Execution summary id
                                   * @return Map containing parameters
                                   */
                                  
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public Map<String, Object> getPersistedParams(long edId, long esId) {
                                  
                                   Query query = em
                                   .createQuery(
                                   "from ResultingParams rp WHERE rp.exSummaryId =:first AND rp.exDetailId =:second")
                                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                                  
                                   // get execution detail of previous step.
                                   query.setParameter("first", esId);
                                  
                                   query.setParameter("second", edId);
                                  
                                   List<ResultingParams> resultParamList = query.getResultList();
                                   Map<String, Object> params = new HashMap<String, Object>();
                                  
                                   if (resultParamList != null) {
                                   // Add in the results in order.
                                   for (ResultingParams resultParam : resultParamList) {
                                   params.putAll(ParamUtil.paramsAsXML(resultParam
                                   .getResultingParamsAsXML(), true));
                                   }
                                   }
                                  
                                   return params;
                                   }
                                  
                                   /**
                                   * Gets the params from the previous transition definition.
                                   *
                                   * @param eSummaryId
                                   * @param stateDef
                                   * @return runtimeParams
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public Map<String, Object> getRuntimeParams(long eSummaryId,
                                   StateDefinition stateDef) {
                                   Map<String, Object> runtimeParams = new HashMap<String, Object>();
                                  
                                   List<TransitionDefinition> transitionDefinitionList =
                                   getTransitionDefinitionsWithToId(stateDef.getId());
                                   for (TransitionDefinition td : transitionDefinitionList) {
                                  
                                   ExecutionDetail prevED = getExecutionDetail(
                                   eSummaryId, td.getFromState().getId());
                                   runtimeParams.putAll(getPersistedParams(prevED
                                   .getId(), eSummaryId));
                                   }
                                  
                                   return runtimeParams;
                                   }
                                  
                                   /**
                                   * Get TransitionDefinitions for a transitionReference id.
                                   *
                                   * @param transitionReferenceId
                                   * @return List of TransitionDefinitionS
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public List<TransitionDefinition> getTransitionDefinitions(
                                   long transitionReferenceId) {
                                  
                                   Query fetchTQuery = em
                                   .createQuery(
                                   "from TransitionDefinition td WHERE td.transitionReference.id =:first")
                                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                                   fetchTQuery.setParameter("first", transitionReferenceId);
                                   List<TransitionDefinition> transitionDefinitionList = fetchTQuery
                                   .getResultList();
                                   if (transitionDefinitionList != null) {
                                  
                                   }
                                   return transitionDefinitionList;
                                   }
                                  
                                   /**
                                   * Get TransitionDefinitions for a toState id.
                                   *
                                   * @param toStateDefId
                                   * @return List of TransitionDefinitionS
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public List<TransitionDefinition> getTransitionDefinitionsWithToId(
                                   long toStateDefId) {
                                  
                                   Query fetchTQuery = em.createQuery(
                                   "from TransitionDefinition td WHERE td.toState.id =:first")
                                   .setHint("org.hibernate.readOnly", Boolean.TRUE);
                                   fetchTQuery.setParameter("first", toStateDefId);
                                  
                                   List<TransitionDefinition> tdList = new ArrayList<TransitionDefinition>();
                                   try {
                                  
                                   List<TransitionDefinition> tempTdList = fetchTQuery.getResultList();
                                   if (tempTdList != null && tempTdList.size() > 0) {
                                   tdList = getTransitionDefinitions(tempTdList.get(0)
                                   .getTransitionReference().getId());
                                   }
                                   } catch (javax.persistence.NoResultException e) {
                                   logger.error("No transition defs found with " + toStateDefId
                                   + " as a 'To' state.", e);
                                   }
                                  
                                   return tdList;
                                   }
                                  
                                   /**
                                   * Handle action for a state definition.
                                   *
                                   * @param stateDefinition
                                   * a state Definition
                                   * @param definitionParams
                                   * @param runtimeParams
                                   * @param params
                                   * The state parameters
                                   * @param user
                                   * a User
                                   * @return a Map<String, Object> the results of a action class method
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public Map<String, Object> handleAction(StateDefinition stateDefinition,
                                   Map<String, Object> definitionParams,
                                   Map<String, Object> runtimeParams, User user) {
                                   Map<String, Object> retmap = null;
                                   try {
                                  
                                   definitionParams.put("user", user);
                                  
                                   Class c = Class.forName(stateDefinition.getActionClass());
                                   Class[] argClasses = new Class[3];
                                   argClasses[0] = StateDefinition.class;
                                   argClasses[1] = Map.class;
                                   argClasses[2] = Map.class;
                                   Method mymethod = c.getMethod(stateDefinition.getActionMethod(),
                                   argClasses);
                                   Object[] args = new Object[3];
                                   args[0] = stateDefinition;
                                   args[1] = definitionParams;
                                   args[2] = runtimeParams;
                                   Object obj = c.newInstance();
                                   retmap = (Map<String, Object>) mymethod.invoke(obj, args);
                                   } catch (Exception e) {
                                   logger.error("An error occured while running an algorithm", e);
                                   throw new RuntimeException(
                                   "An error occured while running an algorithm");
                                   }
                                   return retmap;
                                   }
                                  
                                   /**
                                   * Create execution detail.
                                   *
                                   * @param executionSummaryId
                                   * @param stepDefinitionId
                                   * @return number inserted
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public int insertExecutionDetail(long executionSummaryId,
                                   long stepDefinitionId) {
                                  
                                   Query insertQuery = em
                                   .createNativeQuery("INSERT INTO EXECUTION_DETAIL(EX_SUMMARY_ID, STEP_ID) "
                                   + " VALUES (:first, :second)");
                                  
                                   insertQuery.setParameter("first", executionSummaryId);
                                   insertQuery.setParameter("second", stepDefinitionId);
                                   int noInsert = insertQuery.executeUpdate();
                                   return noInsert;
                                   }
                                  
                                   /**
                                   * Send message to queue.
                                   *
                                   * @param eSummaryId
                                   * @param tdId
                                   * @param user
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void postMessageForNextStep(long eSummaryId, long tdId, User user) {
                                   WorkflowUtil.sendMessage(WorkflowManager.queueName, tdId, user,
                                   eSummaryId);
                                   }
                                  
                                   /**
                                   * Get the ExecutionDetail,StepDefinition,ExecutionSummary and process the
                                   * next step.
                                   *
                                   * @param eSummaryId
                                   * @param stepDefId
                                   * @param user
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void process(long eSummaryId, long stepDefId, User user) {
                                  
                                   // get objects by their id.
                                   ExecutionDetail executionDetail =
                                   getExecutionDetail(eSummaryId, stepDefId);
                                   StepDefinition stepDefinition = em
                                   .find(StepDefinition.class, stepDefId);
                                   ExecutionSummary executionSummary = em.find(ExecutionSummary.class,
                                   eSummaryId);
                                  
                                   // if all needed objects were found, process this step
                                   if (executionSummary != null
                                   && executionSummary.getWhenCompleted() == null
                                   && stepDefinition != null) {
                                   processStep(executionSummary, stepDefinition,
                                   executionDetail, user);
                                   }
                                   }
                                  
                                   /**
                                   * Process a FORK step.
                                   *
                                   * @param eDetail
                                   * @param tDef
                                   * @param tRef
                                   * @param eSummaryId
                                   * @param user
                                   */
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void processFork(ExecutionDetail eDetail, TransitionDefinition tDef,
                                   TransitionReference tRef, long eSummaryId, User user) {
                                  
                                   // place all transitions into queue. Since each will get called
                                   // do the same thing as a
                                   // series. We just don't have a condition.
                                   eDetail.setActionClassCalled("FORK");
                                  
                                   List<TransitionDefinition> transitionDefinitionList =
                                   getTransitionDefinitions(tRef.getId());
                                  
                                   for (TransitionDefinition td : transitionDefinitionList) {
                                  
                                   setExecutionDetailCompleted(eDetail);
                                  
                                   postMessageForNextStep(eSummaryId, td
                                   .getToState().getId(), user);
                                  
                                   }
                                  
                                   }
                                  
                                   /**
                                   * Process a JOIN step.
                                   *
                                   * @param eDetail
                                   * @param tDef
                                   * @param tRef
                                   * @param eSummaryId
                                   * @param user
                                   */
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public void processJoin(ExecutionDetail eDetail, TransitionDefinition tDef,
                                   TransitionReference tRef, long eSummaryId, User user) {
                                  
                                   List<TransitionDefinition> transitionDefinitionList =
                                   getTransitionDefinitions(tRef.getId());
                                  
                                   setExecutionDetailCompleted(eDetail);
                                  
                                   if (areAllJoinTransitionsFinished(
                                   transitionDefinitionList, eSummaryId)) {
                                   postMessageForNextStep(eSummaryId, tDef
                                   .getToState().getId(), user);
                                   }
                                  
                                   }
                                  
                                   /**
                                   *
                                   * @see workflow.ejb.client.WorkflowEngineLocal#processLoop(long,
                                   * workflow.ejb.client.ExecutionDetail,
                                   * workflow.ejb.client.StateDefinition, security.ejb.client.User)
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void processLoop(long eSummaryId, ExecutionDetail eDetail,
                                   StateDefinition stateDef, User user) {
                                   String interval = Long.toString(stateDef.getLoopInterval());
                                   if (!interval.contains(".")) {
                                   interval = interval + ".0";
                                   }
                                  
                                   try {
                                   if (stateDef.getWhenToTest().equalsIgnoreCase("before")) {
                                  
                                   for (; stateDef.getLoopCounter() < stateDef.getLoopMaximum(); stateDef
                                   .setLoopCounter(stateDef.getLoopCounter() + 1)) {
                                   processStateAlgorithm(eSummaryId, eDetail.getId(),
                                   stateDef, user);
                                   Thread.sleep(stateDef.getLoopInterval());
                                   }
                                   }
                                   // whenToTest is assumed to be "after"
                                   else {
                                  
                                   do {
                                   processStateAlgorithm(eSummaryId, eDetail.getId(),
                                   stateDef, user);
                                   stateDef.setLoopCounter(stateDef.getLoopCounter() + 1);
                                   Thread.sleep(stateDef.getLoopInterval());
                                   } while (stateDef.getLoopCounter() < stateDef.getLoopMaximum());
                                   }
                                   } catch (InterruptedException e) {
                                   logger.error("Interruption exception received. ", e);
                                   }
                                  
                                   }
                                  
                                   /**
                                   * Process a SERIES.
                                   *
                                   * @param eSummaryId
                                   * @param tDef
                                   * @param eDetail
                                   * @param user
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void processSeries(long eSummaryId, TransitionDefinition tDef,
                                   ExecutionDetail eDetail, User user) {
                                  
                                   ExecutionDetail prevED = getExecutionDetail(
                                   eSummaryId, tDef.getFromState().getId());
                                   Map<String, Object> params = getPersistedParams(
                                   prevED.getId(), eSummaryId);
                                  
                                   // evaluate condition to move to next state.
                                   boolean res = tDef.getConditionForEval() == null ? true : XPDLUtil
                                   .evaluateCondition(tDef.getConditionForEval(), params);
                                   if (res) {
                                   // move to the next state.
                                   eDetail = getExecutionDetail(eSummaryId, tDef
                                   .getId());
                                  
                                   setExecutionDetailCompleted(eDetail);
                                  
                                   postMessageForNextStep(eSummaryId, tDef
                                   .getToState().getId(), user);
                                   }
                                   }
                                  
                                   /**
                                   * Runs the algorithm.
                                   *
                                   * @param eSummary
                                   * @param stateDef
                                   * @param eDetail
                                   * @param user
                                   * @param em
                                   */
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public void processStateDefinition(ExecutionSummary eSummary,
                                   StateDefinition stateDef, ExecutionDetail eDetail, User user) {
                                  
                                   try {
                                   boolean hasLoop = (stateDef.getLoopMaximum() > 0);
                                  
                                   if (hasLoop) {
                                   processLoop(eSummary.getId(), eDetail, stateDef, user);
                                   } else {
                                   processStateAlgorithm(eSummary.getId(), eDetail.getId(),
                                   stateDef, user);
                                   }
                                  
                                   TransitionDefinition td =
                                   getNextTransitionDefinition(stateDef.getId());
                                  
                                   // finished state processing
                                   setExecutionDetailCompleted(eDetail);
                                  
                                   if (td != null) {
                                   // follow next transition
                                   postMessageForNextStep(eSummary.getId(), td
                                   .getId(), user);
                                   return;
                                   } else {
                                   endWorkflow(eSummary);
                                   }
                                   } catch (Exception e) {
                                   endWorkflowInError(eSummary, eDetail);
                                   logger.debug(e.toString());
                                   }
                                   }
                                  
                                   /**
                                   *
                                   * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflow(workflow.ejb.client.ExecutionSummary)
                                   */
                                   public void endWorkflow(ExecutionSummary eSummary) {
                                   // end workflow
                                   Date completed = new Date();
                                  
                                   eSummary.setWhenCompleted(completed);
                                  
                                   Query updateComplete = em
                                   .createNativeQuery("update EXECUTION_SUMMARY set WHEN_COMPLETED = :first where ID = :second");
                                  
                                   updateComplete.setParameter("first", completed);
                                   updateComplete.setParameter("second", eSummary.getId());
                                   updateComplete.executeUpdate();
                                   }
                                  
                                   /**
                                   *
                                   * @see workflow.ejb.client.WorkflowEngineLocal#endWorkflowInError(workflow.ejb.client.ExecutionSummary,
                                   * workflow.ejb.client.ExecutionDetail)
                                   */
                                   public void endWorkflowInError(ExecutionSummary eSummary,
                                   ExecutionDetail eDetail) {
                                   setExecutionDetailCompleted(eDetail);
                                   endWorkflow(eSummary);
                                   }
                                  
                                   /**
                                   * Process the state algorithm
                                   *
                                   * @param eSummaryId
                                   * Summary ID
                                   * @param eDetailId
                                   * Detail ID
                                   * @param stateDef
                                   * State definition
                                   * @param user
                                   * User
                                   */
                                   private void processStateAlgorithm(long eSummaryId, long eDetailId,
                                   StateDefinition stateDef, User user) {
                                   // get params needed to process step
                                   Map<String, Object> defParams =
                                   getDefinitionParams(eSummaryId, eDetailId, stateDef);
                                  
                                   Map<String, Object> runtimeParams = new HashMap<String, Object>();
                                  
                                   List<TransitionDefinition> transitionDefinitionList =
                                   getTransitionDefinitionsWithToId(stateDef.getId());
                                   for (TransitionDefinition td : transitionDefinitionList) {
                                  
                                   ExecutionDetail prevED = getExecutionDetail(
                                   eSummaryId, td.getFromState().getId());
                                   runtimeParams.putAll(getPersistedParams(prevED
                                   .getId(), eSummaryId));
                                   }
                                  
                                   // run the algorithm
                                   if (stateDef.getActionClass() != null
                                   && stateDef.getActionClass().length() > 0) {
                                   Map<String, Object> resultMap = handleAction(
                                   stateDef, defParams, runtimeParams, user);
                                  
                                   updatePersistedResultParams(eDetailId,
                                   eSummaryId, resultMap);
                                   } else // must be a fork or join state
                                   {
                                   updatePersistedResultParams(eDetailId,
                                   eSummaryId, runtimeParams);
                                   }
                                   }
                                  
                                   /**
                                   * Process step.
                                   *
                                   * @param executionSummary
                                   * an ExecutionSummary
                                   * @param stepDefinition
                                   * a StateDefinition
                                   * @param executionDetail
                                   * an executionDetail
                                   * @param user
                                   * a User
                                   * @param params
                                   */
                                  
                                   @SuppressWarnings("unchecked")
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void processStep(ExecutionSummary executionSummary,
                                   StepDefinition stepDefinition, ExecutionDetail executionDetail,
                                   User user) {
                                  
                                   if (stepDefinition instanceof StateDefinition) {
                                   StateDefinition stateDef = (StateDefinition) stepDefinition;
                                   processStateDefinition(executionSummary,
                                   stateDef, executionDetail, user);
                                   } else if (stepDefinition instanceof TransitionDefinition) {
                                   processTransitionDefinition(executionSummary,
                                   (TransitionDefinition) stepDefinition, executionDetail,
                                   user);
                                   } else {
                                   logger.error("Cannot understand what to process for step with id="
                                   + stepDefinition.getId());
                                   throw new RuntimeException(
                                   "Cannot understand what to process for step with id="
                                   + stepDefinition.getId());
                                   }
                                   addExecutionDetailToExecutionSummary(
                                   executionSummary.getId(), executionDetail);
                                   }
                                  
                                   /**
                                   * Process a TransitionDefinition.
                                   *
                                   * @param eSummary
                                   * @param tDef
                                   * @param eDetail
                                   * @param user
                                   */
                                   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
                                   public void processTransitionDefinition(ExecutionSummary eSummary,
                                   TransitionDefinition tDef, ExecutionDetail eDetail, User user) {
                                  
                                   TransitionReference tRef = tDef.getTransitionReference();
                                  
                                   if (tRef.getTransitionType() == TransitionReference.FORK) {
                                   processFork(eDetail, tDef, tRef, eSummary
                                   .getId(), user);
                                   } else if (tRef.getTransitionType() == TransitionReference.JOIN) {
                                   processJoin(eDetail, tDef, tRef, eSummary
                                   .getId(), user);
                                   } else if (tRef.getTransitionType() == TransitionReference.SERIES) {
                                   processSeries(eSummary.getId(), tDef, eDetail,
                                   user);
                                  
                                   } else {
                                   logger.error("Transition type " + tRef.getTransitionType()
                                   + "is not understood.");
                                   throw new RuntimeException("Transition type "
                                   + tRef.getTransitionType() + "is not understood.");
                                   }
                                   }
                                  
                                   /**
                                   * Sets an ExecutionDetail as completed.
                                   *
                                   * @param eDetail
                                   * @return number updated
                                   */
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public int setExecutionDetailCompleted(ExecutionDetail eDetail) {
                                  
                                   Query completed = em
                                   .createNativeQuery("UPDATE EXECUTION_DETAIL SET COMPLETED = '1' WHERE ID = :first");
                                   completed.setParameter("first", eDetail.getId());
                                   int numUpdated = completed.executeUpdate();
                                   eDetail.setCompleted(1);
                                  
                                   return numUpdated;
                                   }
                                  
                                   /**
                                   * Updates the LOB, PARAMS_AS_XML.
                                   *
                                   * @param edId
                                   * @param esId
                                   * @param params
                                   */
                                   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
                                   public void updatePersistedResultParams(long edId, long esId,
                                   Map<String, Object> params) {
                                  
                                   Query updateResultParamsQuery = em
                                   .createNativeQuery("UPDATE RESULTING_PARAMS SET RESULTING_PARAMS_AS_XML = :first WHERE EX_DETAIL_ID = :second");
                                  
                                   updateResultParamsQuery.setParameter("first", ParamUtil.paramsFromMap(
                                   params, true));
                                   updateResultParamsQuery.setParameter("second", edId);
                                   updateResultParamsQuery.executeUpdate();
                                   }
                                  }
                                  


                                  • 14. Re: JBoss 5 deployment error
                                    jaikiran pai Master

                                    I hadn't tried reproducing this so far. Today i got this reproduced on JBoss-5.0 GA. The issue happens in the following scenario:

                                    1) Your application is packaged as EAR
                                    2) Your application has a jboss-app.xml with classloader configuration (does not matter whether it is java2ParentDelegation=false or java2ParentDelegation=true)
                                    3) You have an EJB in which there is a @Resource injection happening for a application specific type (i.e. the class/interface belongs to your own application)

                                    In this specific scenario, you see this ClassNotFoundException. This is a bug.

                                    "jhsingle" wrote:

                                    There was one other bean with self-injection and I had changed that one also before my last post. Just to be sure, here's the code for WorkflowEngine with the self-injection removed:


                                    I am sure there's definitely some other place where the @Resource injection of application specific class is happening. Are you sure you deployed the fresh files (cleanup existing ones from JBoss).

                                    "jaikiran" wrote:

                                    The code which you posted, shows self-injection


                                    Based on the test case that i have, this has got nothing to do with self-injection. Injecting resource of type myapp.A into myapp.B manifests this problem.

                                    Possible workarounds:

                                    1) Probably the easiest - Remove all @Resource injection of application specific classes
                                    OR
                                    2) Deploy the application as a standalone jar instead of EAR. The problem does not arise in a standalone jar
                                    OR
                                    3) Do not configure classloading through jboss-app.xml - You can leave that file empty or remove it. From what you posted, i see that you are not using this jboss-app.xml for anything else.



                                    1 2 Previous Next