4 Replies Latest reply on Feb 15, 2011 9:41 AM by berni123

    ESB deployment in EAR



      I'd like to ask about deployment of ESB archives. We are developing application, which target packaging is EAR. It uses ESB services, JBPM processes, EJBs and Web application.
      My idea is to put all archives to one EAR. I'm not sure about target deployment of ESB archives, I have not found exactly explained, if ESB archive can be put in EAR application or if it has to be put outside.
      As we experimented, only putting ESB inside ear does not deploy ESB services. The workaround is to add java module definition into application.xml for desired ESB archive, e.g.


      The problem with ESB archives outside EAR is that it uses EJBs and actions which are part of EAR application.
      So the other way we tried put ESB archives outside of EAR archive.
      Then we needed to define dependency on desired JARs in -service.xml (within ESB archive), e.g.:
       <classpath codebase="deploy/MyEAR.ear" archives="MyEJBs.jar"/>

      So my question is, what is the preferred way for deploying ESB archives?

      Thanks a lot for any suggestions.


        • 1. Re: ESB deployment in EAR

          Unfortunately, one more issue.
          Definition of dependencies in -service.xml has one uncomfortable consequence - application EAR is needed to be deployed exploded. I don't know how to define dependency of service to JAR within packed EAR. This issue I'll need to solve anyway, even if my ESB services will be inside the EAR archive (jbpm.esb has to define dependency on JARs, where are custom action classes for our deployed processes).

          • 2. Re: ESB deployment in EAR

            The helloworld_hibernate_action has an example of how to build an EAR and how to set it up - can you take a look at that? I'm a little confused with what you are doing here - can you take a look at that quickstart and then rephrase your questions?

            • 3. ESB deployment in EAR


              Did you ever find a way to resolve these deployment issues? I am having the same type of problems of wanting to deploy me .esb archive within the ear file.



              • 4. Re: ESB deployment in EAR


                I finally manged to include an esb-archive inside the ear archive.

                The trick is to read the maven ear plugin Configuration|Modules page til the end: "Adding Custom Artifact Types".


                I'm using following pom:


















                                        <artifactTypeMapping type="esb" mapping="jar" />





                You see the trick is to define the artifactTypeMapping, and including the esb artifact as jarModule.

                Moreover the option includeApplicationXml=true gurantees that there is an esb-entry in the generated application.xml.

                The unpack=true is just a matter of taste, i prefer to include the esb as exploded dir.