6 Replies Latest reply on Sep 13, 2006 4:06 PM by Doug Palmer

    How should I package my .sar

    Doug Palmer Newbie

      Hi

      I am building a small process engine that I would like to package as a sar. The engine consists of:

      A data source described in a -ds.xml file.
      3 JMS queues and an MBean described in a -service.xml.
      An EntityManager described in a persistence.xml.
      2 EJB3 entity beans
      2 EJB3 message driven beans

      If I package everything in a jar then it all works but if I package it as a sar the EJBs don't deploy. I've tried putting the classes in the sar; packaging them in a jar and putting that in the sar; packaging the jar in an ear, with an application.xml and putting that in the sar.

      How should I package my EJBs and persistence.xml in my sar so that they still deploy?

      Regards
      Doug

        • 1. Re: How should I package my .sar
          Elias Ross Master

          Use a .ear, put the services in a .sar, list your -ds.xml and .sar in your application.xml etc.

          • 2. Re: How should I package my .sar
            Doug Palmer Newbie

             

            "genman" wrote:
            Use a .ear, put the services in a .sar, list your -ds.xml and .sar in your application.xml etc.


            Thanks for the response Genman. Unfortunately packaging as an ear presents the same problem as packaging as a jar. Namely, the -ds.xml and -service.xml files can't be customised without repackaging the service. Do you know if it is possible to package everything within a .sar?

            Regards
            Doug

            • 3. Re: How should I package my .sar
              Jimmy Wilson Apprentice

               

              "Doug.Palmer" wrote:
              "genman" wrote:
              Use a .ear, put the services in a .sar, list your -ds.xml and .sar in your application.xml etc.


              Thanks for the response Genman. Unfortunately packaging as an ear presents the same problem as packaging as a jar. Namely, the -ds.xml and -service.xml files can't be customised without repackaging the service. Do you know if it is possible to package everything within a .sar?


              Maybe I am missing something, but couldn't you just deploy an "exploded" EAR? That would leave the files available for modification.

              • 4. Re: How should I package my .sar
                Doug Palmer Newbie

                 

                "jiwils" wrote:
                "Doug.Palmer" wrote:
                "genman" wrote:
                Use a .ear, put the services in a .sar, list your -ds.xml and .sar in your application.xml etc.


                Thanks for the response Genman. Unfortunately packaging as an ear presents the same problem as packaging as a jar. Namely, the -ds.xml and -service.xml files can't be customised without repackaging the service. Do you know if it is possible to package everything within a .sar?


                Maybe I am missing something, but couldn't you just deploy an "exploded" EAR? That would leave the files available for modification.


                Yes, I suppose I could. I guess I'm being too much of a purist. My package is a service so I really wanted to deploy it in a sar but I guess I'll have to deploy it as an exploded ear.

                Regards
                Doug

                • 5. Re: How should I package my .sar
                  Jimmy Wilson Apprentice

                   

                  "Doug.Palmer" wrote:
                  Yes, I suppose I could. I guess I'm being too much of a purist. My package is a service so I really wanted to deploy it in a sar but I guess I'll have to deploy it as an exploded ear.


                  Your post unfortunately indicates there are problems with that approach (though I am not sure what they are). I have deployed SARs containing SARS, -service.xml, and even WARs before, but I haven't tried EJB JAR files or EARs before now. I just tried embedding an EAR in a SAR, and the EAR deployed. I have not tried EJB JAR files however.



                  • 6. Re: How should I package my .sar
                    Doug Palmer Newbie

                     

                    "jiwils" wrote:
                    Your post unfortunately indicates there are problems with that approach (though I am not sure what they are). I have deployed SARs containing SARS, -service.xml, and even WARs before, but I haven't tried EJB JAR files or EARs before now. I just tried embedding an EAR in a SAR, and the EAR deployed. I have not tried EJB JAR files however.


                    I think the problem arises because an ejb3 jar is indistinguishable from any other jar without scanning every class for annotations. Sar files aren't expected to contain ejbs therefore it is more efficient not to check whether a jar contains ejb3 annotations.

                    Regards
                    Doug