4 Replies Latest reply on May 19, 2009 7:22 AM by jaikiran pai

    Struts + ClassLoading

    Thorsten Anzenberger Newbie

      Hello

      We are using JBoss 5.0.1 and we try to make a new Web App.

      So, first we have an EAR with all jars in it.
      Then we have a WAR which contains just the core.
      The EAR get deployed, we can start it and we see the page(index).

      But when we try to add struts(1.x.x) we get some problems.

      Fist, when we add struts.jar to the EAR the class-Loader doesnt find it.
      We get the error :

      2009-05-19 09:54:10,156 WARN [org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookPreJSE] (main) Cannot load servlet class: org.apache.struts.action.ActionServlet
      


      When we add struts.jar to WEB-INF/lib in the WAR he finds it.
      In our other Project we have all jars in the EAR and everything works fine.


      Our 2nd Problem :

      In struts-config.xml we defined that the MessageResourceFactory Class is in a specific package. We added that JAR to the EAR but he cant find it.


      package not found xx.xx.xxx.xxx_xxxxx.xxx.mymessageresource
      defined package: xx.xx.xxx.xxx_xxxxx.xxx.mymessageresource
      loadClass org.apache.struts.util.MessageResourcesFactory resolve=false
      


      In the other Project everything works fine :

      package not found xx.xx.xxx.xxx_xxxxx.xxx.mymessageresource
      defined package: xx.xx.xxx.xxx_xxxxx.xxx.mymessageresource
      loaded class locally class xx.xx.xxx.xxx_xxxxx.xxx.mymessageresource.MyMessageResourceFactory{cl=BaseClassLoader@1499c0f{vfszip:/D:/ENTWICKLUNG/dv-java/jboss-5.0.1.GA/server/default/deploy/xxxxxx.ear/} codeSource=(jar:file:/D:/ENTWICKLUNG/dv-java/jboss-5.0.1.GA/server/default/deploy/xxxxxx.ear!/xxx_xxxxxxx.jar <no signer certificates>)}
      


      So why does on Project find the Class in the Jar, and the other doesnt ?
      We are using the same Jboss, we just wanted to do a new EAR.

      Anyone can help ?