1 Reply Latest reply on Nov 15, 2002 10:29 AM by lepekhine

    WEB-INF/lib class loader issue, with ejb.jar Fixed in 4-alph

    russwyte

      Hello all,

      First Kudos to the whole JBoss team - you all rock.

      Just thought I would share my latest frustration. I am not sure if there is a resolution in 3.0.4 or not, but I know using 4-alpha the problem goes away.

      Here it is:

      I have and ear file that looks like this

      seneca.ear
      web.war
      ejb.jar

      here is application.xml:


      <display-name>Seneca</display-name>
      A seneca application!


      <web-uri>web.war</web-uri>
      <context-root>mojo2</context-root>



      ejb.jar

      <security-role>
      <role-name>user</role-name>
      </security-role>


      ejb.jar contains a few simple ejbs, they all work fine, no issues here.

      web.war contains some JSPs and Servlets which break with ClassDefNotFound exceptions when they try to instantiate objects from classes in jars in the in WEB-INF/lib directory.

      The strange thing is that if I take out the ejb module, the web application works fine and loads all of the correct classes.

      <display-name>Seneca</display-name>
      A seneca application!


      <web-uri>web.war</web-uri>
      <context-root>mojo2</context-root>


      <!--

      ejb.jar

      -->
      <security-role>
      <role-name>user</role-name>
      </security-role>


      I have isolated the problem as a class loader issue, but I have no idea how to fix it in 3.x except to copy the jar libraries from WEB-INF/lib into the servler/*/lib directory. This however is a very bad fix. It totally breaks application indpendance.

      Any ideas?
      Has anybody else had similar issues?

      I will send the entire .ear to anybody who thinks they can help.

        • 1. Re: WEB-INF/lib class loader issue, with ejb.jar Fixed in 4-
          lepekhine

          I had the similar problem in 4.0.0alpha - it can not instatiate classes from WEB-INF/classes during servlet deployment, but can instatiate them if they are packed in jar in WEB-INF/lib.
          In 3.0.0 version JBoss could intatiate classes from WEB-INF/classes.
          I didn't try pack them into jar so I don't know what would be so far but I believe you.
          As for me I had so many troubles with 4.0.0alpha that I decided to wait for official release and return to 3.0.0 version wich seems to me more or less working. Even 3.0.4 I consider to be worse - it can not unlock beans locked (what I don't understand) and my applications that worked in 3.0.0 don't work in 3.0.4. Sorry if I didn't help you. I can advice only to take 3.0.0 and put your classes in WEB-INF/classes. It works for me pretty well.