5 Replies Latest reply on Jul 30, 2002 12:19 PM by Paul D. Brown

    dependent EJB jars within the same EAR

    Paul D. Brown Newbie

      I am trying to deploy 3 jars containing EJBs to JBoss 3. Two of the jars depend on the third and this is reflected in the ClassPaths in their metafiles.
      I can successfully deploy them separately by specifying them individually in the comma-delimited list of "URLs" for the URLDeploymentScanner MBean. However, I would like to deploy them as part of an .ear file.
      So far, I've tried using an unpackaged ear, that is, a directory myapp.ear, beneath which are the three jars and a META-INF directory containing the application.xml file below:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
      Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">


      <display-name>Whatever</display-name>


      core.jar


      dependent1.jar


      dependent2.jar





      I've tried deploying this using both the URLDeploymentScanner and URLDirectoryScanner MBeans specifying the attribute appropriately to the scanner as myapp.ear rather than specifying the individual jars. Each time, the deployment fails; it seems to deploy the core.jar successfully but, when deploying the dependent jars, complains that the core is already registered.
      (note: I am using <ejb-link>core.jar#EJBClass</ejb-link> in my dependent jar deployment descriptors).

      Could anyone please tell me how I should deploy dependent EJB jars within the same ear, whether that is a packaged ear or an unpacked directory. Thanks.

        • 1. Re: dependent EJB jars within the same EAR
          Paul D. Brown Newbie

          Replying to my own message here but anyway...

          I have now tried deploying this as a packaged ear file (as opposed to a using a folder called whatever.ear) but it's the same result - when it attempts to deploy the dependent jars, it complains that my core.jar is already registered.

          Is it, as seems to be the case, impossible to deploy an enterprise application archive (ear) containing two or more EJB jars in JBoss? If so, this goes against the J2EE specification (see the DTD for ear files).

          It may be that I am simply configuring the deployment wrongly. In that case, could someone please put me straight.

          Many thanks,
          -Paul

          • 2. Re: dependent EJB jars within the same EAR
            Jake Fear Newbie

            I am having some luck with the same issue, but I have not completed my deployment yet. I have been removing the references to other jar files referenced in application.xml as ejb modules from the manifest Class-Path: entries in jar files. It seems that the redundancy is the source of trouble. I will post an update if I get everything smoothed out with this attempt to let you know.

            Jake

            • 3. Re: dependent EJB jars within the same EAR
              Jake Fear Newbie

              Seems to be working well for me. I hope this helps you...

              • 4. Re: dependent EJB jars within the same EAR
                Paul D. Brown Newbie

                Thanks Jake - that does work.

                Unfortunately, it only seems to work for packaged ear files. If I try to fool it by using a folder named whatever.ear, it does not work - complaining that the dependent jar cannot find classes in the core jar. I was hoping that the latter would work because it's quicker for development to just drop in any changed jars.
                I guess one of these days I am going to have to learn to use something like Ant for deployment, huh?

                Anyway, thanks again,
                -Paul

                • 5. Re: dependent EJB jars within the same EAR
                  Paul D. Brown Newbie

                  Apologies if this message appears twice - my original posting of it has, for now at least, vanished.

                  Thanks Jake - you're right, removing the core jar from the classpath in the manifest does work.

                  Unfortunately, it only works if the ear is a packaged archive file. It does not work if I try to fool the system by using a folder called whatever.ear (which sometimes works for other stuff). I was hopeing to use the latter because it makes development easier, being able to just drop in any changed jars. I guess that I am just going to have to learn to use something like Ant for deployment, huh?

                  Anyway, thanks again,
                  -Paul