1 Reply Latest reply on Jun 26, 2013 4:41 AM by wdfink

    Including external/third-party JARs in app on JBoss 7.1.1

    mbpolan

      Hi everyone,

       

      I'm a bit of a newbie when it comes to JBoss, so please correct me if I misunderstood something.

       

      Anyway, I'm attempting to port an existing webapp from Tomcat 7 to a new JBoss 7.1.1 instance, and I'm a bit confused about getting all of my JAR dependencies resolved. There exists a collection of JAR files that are externally supplied by a third-party, and let's say they are located under $JAVA_HOME/lib/other on the end-user's machine. My webapp needs these JARs to be available, and so far, it seems that making a module for them is the way to go. However, I don't want to copy these JAR files to the module directory, because depending on what version of the JARs the user has (and their Java version), there could be differences in the code contained in those files. In Tomcat, I would just make sure that the aforementioned path was added to the classpath before my webapp was deployed, and everything would be loaded correctly. Is this kind of approach possible to do in JBoss?

       

       

      Thanks!

        • 1. Re: Including external/third-party JARs in app on JBoss 7.1.1
          wdfink

          I don't think that this will be possible in AS7.

          To separate the different applications with the dependencies there are different classloaders for each application, see AS7 classloading.

          A way that looks possible is to add this libraries as a modul, create the module.xml and use symbolic links. Also you can have different versions (main, 1.1,1.2 ...) that applications can run with different dependencies in the same server.