1 Reply Latest reply on Jan 25, 2006 3:26 PM by Frank LaRosa

    Error deploying two webapps containing the same EJB

    Frank LaRosa Newbie

      Hi,

      I have two separate webapps that use the same EJB. The EJB jar file is packaged and deployed with each app as part of its EAR.

      If I deploy the applications separately to different servers they work fine, but if I try to deploy them to the same server I get an exception:

      org.jboss.deployment.DeploymentException: Trying to install an already registered mbean

      I am suprised by this because I was under the impression that everything associated with an EAR is supposed to be isolated from other EARs, even as far as using different classloaders.

      I realize that I could deploy the EJB separately from the two applications but this is not what I'd prefer. The applications are otherwise unrelated to one another and I want them to be self-contained so that someone else can decide where to deploy them without worrying about an external dependency. I also want it to be possible for one to be using a different version of the EJB without impacting the other.

      Is this a common problem, and if so, how should I deal with it?

      Thanks.

        • 1. Re: Error deploying two webapps containing the same EJB
          Frank LaRosa Newbie

          On closer inspection, it appears to be the data source names that are colliding rather than the EJB itself.

          Because the EJB asks for a particular data source by name, both projects have a data source with that name, although they point to different databases.

          The way I deploy my datasources XML file is by including it in a .SAR directory within the .EAR directory - I'm not completely sure what a .SAR is, but someone showed me how to do it this way years ago. Perhaps it's not the best way.

          Frank