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

    Sharing classes between SAR files

      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
          andrewboyd

          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
            andrewboyd

            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