3 Replies Latest reply on Mar 30, 2006 8:33 AM by Stacey Vetzal

    EAR for BPM services

    Jim Rigsbee Newbie

      Howdy,

      Last night I discovered that I'm going to need to use an EAR to make sure my MDB and SLSB get deployed correctly. It is also good J2EE practice :)

      I believe the WAR should become part of this as well. Any objections?

      I'll create the EAR staging in the resources folder like I did the MDB and SLSB and we can add the WAR into the ant script when you are ready, if you agree.

      Have a great day!

      Regards, Jim

        • 1. Re: EAR for BPM services
          Tom Baeyens Master

          we should support both EAR and WAR.

          By default i want a war that is also deployable on tomcat...

          I don't mind if there are targets that build and deploy an ear in the build.deploy.xml.

          • 2. Re: EAR for BPM services
            Jim Rigsbee Newbie

            No problem, I agree...forgot about pure servlet containers like Tomcat, good catch.

            Regards, Jim

            • 3. Re: EAR for BPM services
              Stacey Vetzal Newbie

              I think ClassLoader issues will plague anyone deploying the WAR to JBoss who does not understand them. Right now, I class myself there - slowly untangling what I need to understand to complete the vision in my head.

              Domain-specific ActionHandler classes that are direct EJB clients is one area I've had trouble.

              Right now, our strategy is decoupling the workflow from the domain logic using JMS queues, but I expect others will share my initial desire to use domain-specific logic in their ActionHandlers.

              One thing I have not yet tried is bundling the jbpm.sar in the EAR so that it too shares the same class-loader, but this seems non-scalable - especially if you want to orchestrate several applications with a single workflow engine.

              My panacea is an isolated workflow engine that can have workflows arbitrarily deployed to it, each with self-contained domain knowledge (ie ejb-client jars embedded).

              Am I crazy here not being able to get this to work easily? Perhaps our stand-alone process deployer is not doing something that it should be?

               public void init(DeploymentInfo di) throws DeploymentException {
               log.info("Deploying jBPM archive: " + di.url);
              
               try {
               // parse for getting name
               ProcessDefinition processDef = ProcessDefinition.parseParZipInputStream(new ZipInputStream(new FileInputStream(di.url.getPath())));
               String name = processDef.getName();
              
               InitialContext iniCtx = new InitialContext();
               JbpmConfiguration conf = (JbpmConfiguration) iniCtx.lookup("java:/jbpm/JbpmConfiguration");
              
               ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(di.url.getPath()));
               ProcessDefinition pd = ProcessDefinition.parseParZipInputStream(zipInputStream);
              
               JbpmContext ctx = conf.createJbpmContext();
               ctx.deployProcessDefinition(pd);
              
               ProcessDefinition latestPd = ctx.getGraphSession().findLatestProcessDefinition(name);
               if (latestPd != null) {
               log.info("Deployed process \"" + name + "\" version: " + latestPd.getVersion());
               } else {
               log.info("Error deploying: " + name);
               }
              
               } catch (NamingException e) {
               e.printStackTrace();
               } catch (FileNotFoundException e) {
               e.printStackTrace();
               }
               }