2 Replies Latest reply on Aug 11, 2010 8:15 AM by saltnlight5

    class loader to include jars in external folder

    javatwo

      Hello, we have a war application with lib folder

      WEB-INF/lib/core.jar

       

      The war application allow users to add external jars without repackaging the war file, For example

       

      <INSTALL-DIR>/external/a.jar

      <INSTALL-DIR>/external/b.jar

       

      users can add jars(a.jar,b.jar),and then restart JBOSS. If we add a.jar/b.jar to server/default/lib,  we got classNotFound error

      because external jars (a.jar, b.jar) have references to classes in the war.  If it does not need to restart JBoss, it is a plus.

       

      Can I configure JBoss ClassLoader to load the external jars as if they were under WEB-INF/lib of war file? If we need to

      implement our own class loader, could any one help me get started to achieve this goal?

       

      Thanks,

      Dave

        • 1. Re: class loader to include jars in external folder
          javatwo

          We use JBoss 5.1.0.

          • 2. Re: class loader to include jars in external folder
            saltnlight5

            A standar war WEB-INF/lib/*.jar are not accessable outside of that WAR application.

             

            The WAR webapp can access class in your their own WEB-INF/lib/*.jar obviously, and if it not found there, it then looks for those in JBOSS_HOME/server/<profile-server>/lib, then JBOSS_HOME/common/lib (if you use default), and then JBOSS_HOME/lib. But applications outside of the webapp in JBoss can't access the war's WEB-INF/lib/*.jar.

             

            A webapp WAR's WEB-INF/lib/*.jar are automatically reloaded whenever you redeploy your war file. All other server lib directories requires you to restart JBoss to pickup new jars.

             

            Search JBoss classloader in wiki and google to see more info.