4 Replies Latest reply on Apr 11, 2002 8:30 AM by michael_r

    Reference support jars or classes across beans

    cdemyanovich

      What is the "best practice" for referencing jars or classes that support multiple EJBs? An example of such a class could be a common exception; an example of such a jar would be one that contains a Service Locator implementation. I've searched the forums, but my success has been very limited. Many links to the docs are no longer accurate, and I've been overwhelmed with hits, not being able to narrow my search sufficiently to be useful. Many thanks in advance for your time on this.

      Craig

        • 1. Re: Reference support jars or classes across beans
          armint

          I suggest packaging your ejb-jars and support jar into an ear file. In the manifest file of each ejb-jar put an entry like: Class-Path: support.jar . The ear package could look like this:

          app.ear
          ----META-INF/application.xml
          ----ejb.jar
          --------META-INF/manifest.mf Class-Path: support.jar
          ----support.jar

          • 2. Re: Reference support jars or classes across beans
            sirl

            I have tried this with jboss2.2.4 Tomcat4.0.1 but it does not reload the jars which are in lib/ext?

            The ear files contain ejbs with a Manifest.mf with:
            Class-Path: Dusk.jar Foundation.jar

            but when I redeploy these two jars in jboss/lib/ext, and the ear file in the jboss/deploy directory, unfortunately the system does not refresh the two jars above from lib/ext. I have to restart jboss. Either I've done something wrong or jboss does not support section 8.1.2 of J2EE 1.3. see article at http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html?page=2

            • 3. Re: Reference support jars or classes across beans
              sirl

              My mistake...this does work. Because the ear file is put in the temp directory, the Class-Path manifest must point to those files...or if I package the jars with the ear file and have the manifest state them, then it does reload them on deployment(note application.xml does not mention the utility jar files).

              Regards,
              Sirl

              • 4. Re: Reference support jars or classes across beans
                michael_r

                Hi,
                I also used the Class-Path entry but I put the support jars into a subdirectory under jboss/deploy in order not to be autodeployed as EJBs (MANIFEST.MF Class-Path: subdir/support.jar).
                When redeploying the support jars the EJB jars have to be touch ed.
                The advantage is that JBoss does not have to be restarted.

                Regards,
                Michael