6 Replies Latest reply on Oct 11, 2002 11:30 AM by Greg Turner

    Packaging Question

    Mike Ladwig Newbie

      Hi. I've got a web application that includes several ejbs (session & entity), servlets, and a couple of mbeans.

      I'm not sure how to most package these things for deployment. As it stands, I have
      - a .jar file with the bean class files
      - a .sar file with the jboss-service.xml file that depends on the .jar file
      - a .war file with the jboss-web.xml and servlet classes

      I don't think this is the right way to deploy this because depending on the exact build/deploy/restart I get error messages that indicate the service is being started twice (during the war deployment), or that a non-existant service is being removed. Other than these warnings, things work OK.

      Can somebody point me at the "right" way to package these elements?

      Also, apparently the ".sar" file is jboss specific. Is there a generic equivalent?

      Thanks,
      mike.

        • 2. Re: Packaging Question
          Mike Ladwig Newbie

          Thanks - this is an excellent article!

          However, in "The Limitations of Packaging", it basically says JMX MBeans aren't covered by the article. So, I guess the .sar file is a necessary evil. Do the jboss deployment mechanisms ear, war, or jar files provide for embedding sars?

          • 3. Re: Packaging Question
            Mike Ladwig Newbie

            I found the answer to my own question; alongside the application.xml file, one can have a jboss-app.xml file that can in turn specify the .sar file.

            The remaining problem I have is that when I undeploy (by deleting the ear from server/default/deploy, I get a variety of error messages (appended below). The first I have absolutely no idea what it's about. The second indicates to me that for some reason jboss is trying to stop the service twice (it successfully stops it earlier in the log trace).



            15:52:48,128 INFO [MainDeployer] not deleting localUrl, it is null or not a copy: file:/usr/java/jboss-3.0.3/server/default/tmp/deploy/serv
            er/default/deploy/owr.ear/82.owr.ear-contents/owr.war

            and the other is15:52:48,129 WARN [ServiceController] Ignoring request to destroy non-existant service: owr:service=SequenceGeneratorService,name=mbean/owr
            /SequenceGeneratorService

            • 4. Re: Packaging Question
              Greg Turner Apprentice

              Yes, sar files are specific to JBoss. The JBoss docs cover what is in a sar file. Or you can unjar any of the sar files that come with JBoss to see the structure. I think you can put a sar file inside an ear file, but I am not sure of the specifics and I am not sure why you would want to.

              • 5. Re: Packaging Question
                Sacha Labourey Master

                You can use JBoss "Russian Doll" packaging: you can put any xAR in any xAR (SAR in EAR in JAR in WAR in ...). The rule is "INNER FIRST, OUTER LAST". By playing smartly, you can even have all your dependencies between your components satisfied.

                • 6. Re: Packaging Question
                  Greg Turner Apprentice

                  Not sure about these errors, but it helps debugging to start with a clean slate. So shut down JBoss. Then delete the tmp directory that is within default. Then start up JBoss and see if you have same problems.