2 Replies Latest reply on Mar 29, 2004 4:32 PM by Andrew Boyd

    Sharing classes between SAR files

    Jean-Francois Daune Newbie

      Hi all,

      I wonder what is the best way to share classes between several SAR files.

      I observed that classes in a JAR contained in SAR file 1 are not visible in SAR file 2 (I get class not found exception).

      My first thought is to package the common classes in a JAR and put this one under server/lib.

      But maybe there is a more elegant way to manage such dependencies ?

      Any help would be greatly appreciated.

      Best Regards,

      Jean-François

        • 1. Re: Sharing classes between SAR files
          Andrew Boyd Novice

          Would this not work for you? In the sar1-service.xml



          <classpath codebase="/../../lib/" <!-- your own lib dir -->
          archives="*"/>
          ... sar one mbeans etc ...


          and in sar2-service.xml



          <classpath codebase="/../../lib/" <!-- your own lib dir -->
          archives="*"/>
          ... sar two mbeans etc ...


          The classes would be the same yet maybe not what you were looking for?

          Andrew

          • 2. Re: Sharing classes between SAR files
            Andrew Boyd Novice

            Lets try again with better formatting.

            Would this not work for you? In the sar1-service.xml

            <service>
            
             <classpath codebase="/../../lib/" <!-- your own lib dir -->
             archives="*"/>
             ... sar one mbeans etc ...
            </service>
            

            and in sar2-service.xml

            <service>
            
             <classpath codebase="/../../lib/" <!-- your own lib dir -->
             archives="*"/>
             ... sar two mbeans etc ...
            </service>
            


            The classes would be the same yet maybe not what you were looking for?

            Andrew