5 Replies Latest reply on May 28, 2003 3:25 AM by frito

    can not opened Class-path file from manifest

    qjafcunuas

      Hi
      I'm using Jboss3.2.1 with Tomcat on Linux Debian.
      I'm trying to use Class-path directive in manifest file.

      I've got 2 file in my deploy directory : file.ear and file.war
      The manifest file from file.war has got the directive :
      Class-Path: file.ear

      When i start Jboss, it begins started file.war, and says :
      2003-05-27 12:49:31,606 WARN [org.jboss.deployment.MainDeployer] The manifest entry in file:/usr/local/ws/deploy/file.war references URL file:/usr/local/deploy/file.ear which could not be opened, entry ignored

      So the deployement of file.war is on error because it uses classes from file.ear
      (EJB)

      Can somebody help me ?

      tia

      Bruno

        • 1. Re: can not opened Class-path file from manifest
          frito

          Hi,
          the Class-Path must contain .jar files, nothing else. Every jar listed in the Class-Path will then be ignored by the deployer (even if there is a deployment descriptor in its META-INF).
          To achieve what you wanted to do, put the shared classes in a jar file. Then you have to build a ear with this jar in and your war. Add the jar file to the Class-Path of your manifest.mf in your war.

          You should take a look at the J2EE spec, chapter 8 deployment and assembly.

          Greetings,
          Frito

          • 2. Re: can not opened Class-path file from manifest
            qjafcunuas

            Hi,
            thanks for your answer.

            My file.war file can't be included in file.ear, because it's an optionnal module.
            So, I've put in file.war the class from the ear it needs.

            The trouble is that now i've got this exception :
            java.lang.LinkageError: loader constraints violated when linking myClass class.
            I think that it means i cannot load myClass.class twice : one by file.war and one by file.ear

            What can i do ? How can i resolve my trouble ?

            tia

            Bruno

            • 3. Re: can not opened Class-path file from manifest
              jonlee

              Try putting the shared classes in a jar and in server/default/lib or whatever appropriate instance library? Best approach if it is shared amongst applications.

              • 4. Re: can not opened Class-path file from manifest
                maciej.bajolek

                Hi *,

                I have similar problem with classpath ...

                (Question 1)

                I have application which has some ejb modules. My EAR file looks like:

                wms.ear/
                + config/
                L config.properties

                +META-INF/
                Lapplication.xml
                |-manifest.mf
                Ljboss-app.xml

                -ejb-module.jar

                I need to have file: config.properties in ejb-module.jar classpath (there is configuration of a module).

                When I use WLS or OC4J, I add "Class-Path: config" entry to ejb-module.jar manifest.mf file and in my Config service I access file using getResourceAsStream("/config.properties") method, it works fine.

                Unfortunatelly in JBoss 3.2.1 I get following worning messages:

                -
                18:22:26,102 WARN [MainDeployer] The manifest entry in file:/C:/jboss/server/default/tmp/deploy/ser
                ver/default/deploy/wms.ear/51.wms.ear-contents/mdb-ejb.jar references URL file:/C:/jboss/server/defa
                ult/tmp/deploy/server/default/deploy/wms.ear/51.wms.ear-contents/config which could not be opened, entry ignored
                -

                Is there any other solution for it?
                As I understand Manifest.mf Class-Path entry should only contain references to jars. How can I read configuration from property file?



                (Question 2)
                As I mentioned before I use JBoss 3.2.1. How can I deploy my application using EXPLODED directory format. When I unpack EAR and all modules, change application.xml module entries pointing to directory (module) instead of jars/wars

                I read that all I need is to unpack EAE ant its modules into JBoss's deploy directory ant everything will be ok.
                It does not work!

                Am I doing something wrong?
                How can deploy application using Exploded directory format?

                --
                best regards
                Maciek

                • 5. Re: can not opened Class-path file from manifest
                  frito

                  @qjafcunuas
                  try this, as it works for me:

                  1. put your dependency libs in your ear
                  2. each lib has to be listed in your application.xml like this for xerces:
                  [pre]

                  xerces.jar

                  [pre]
                  3. each .jar (ejb) or .war (or whatever) MUST have an entry in its Class-Path of the manifest.mf like this:
                  [pre]
                  Class-Path: ./xerces.jar
                  [/pre]
                  4. use the entry shown above in your jboss-app.xml to use a new loader repository for your ear

                  That's all. More info about this in the J2EE spec (Chapter 8, Assembly and Deployment) and the JBoss doco (look at sourceforge, the ClassLoader issue).

                  Greetings,
                  Frito