1 Reply Latest reply on Apr 9, 2005 7:15 AM by Andy Nguyen

    Classpath problem - Sequences of jar files in the classpath

    Nirmalya Mishra Newbie

      Hi All,


      We have a J2EE application deployed on JBOSS 4.0.0 on Solaris 8.
      The site starts properly without error.
      However we are facing problems in the way the jar files put in the lib folder is interpreted by JBOSS.
      Ideally the sequence/order of jar files should be alphabetically.
      This is the way it works on Windows environment also.
      Since this(sequence/order of jar files) is not happening in JBOSS on Solaris few of the overriden classes (packged in side the jar) don't appear in the classpath.
      Hence the application doesn't work as it supposed to.

      Any help/pointers is most welcomed.

      Nirmalya

        • 1. Re: Classpath problem - Sequences of jar files in the classp
          Andy Nguyen Newbie

          As far as I know, there's no easy way to control the order of jar files in the server/xxx/lib directory or even the WEB-INF/lib directory of a webapp.

          For webapps, you can place your overridden classes in WEB-INF/classes, as WEB-INF/classes must come before any jars in WEB-INF/lib in the classpath according to the servlet spec.

          If you want to override classes that are in JBoss' server/xxx/lib/*.jar, you can try this. Create folder server/xxx/classes. Modify server/xxx/conf/jboss-service.xml. Add a line before

          <classpath codebase="lib" archives"*"/>
          like this
          <classpath codebase="classes"/>
          <classpath codebase="lib" archives"*"/>
          . I haven't tried this myself so I'm not sure if this would work. In particular, I'm not sure if JBoss obeys the ordering of classpath elements in jboss-service.xml.

          HTH