4 Replies Latest reply on Jun 22, 2009 2:37 AM by jaikiran

    where to put shared jar in ear file

    javatwo

      For an ear file that contains two web modules that use one common lib jar, where to put the common lib jar? Thanks!

      Dave

        • 1. Re: where to put shared jar in ear file
          peterj

          You never said which version of JBoss AS so I will assume 5.0.x or 5.1.0. Create a 'lib' directory within the EAR and place the common JAR there. Here's and example EAR file layout:

          first.war
          second.war
          lib/common.jar
          META-INF/application.xml

          There is no need to reference the common.jar in application.xml (unless you are not using AS 5.x...)

          • 2. Re: where to put shared jar in ear file
            javatwo

            yes. we use JBoss 5.0.1.GA.
            Thanks for help.

            • 3. Re: where to put shared jar in ear file
              javatwo

              The two web modules share some css and java scripts files. Can we put them in a common place? Right now they are in each web module war file.

              How about jsp files? for shared jsp files, can they be put in common place too?

              Thanks,
              Dave

              • 4. Re: where to put shared jar in ear file
                jaikiran

                I don't think that would be possible because the jsp, .js and css belong to a web application "context". So whenever you request those resources they are looked for within that context. And since each web app has its own context, you probably wont be able to share this.