2 Replies Latest reply on Nov 11, 2004 9:50 AM by wapdat

    Struts resources, not found in classpath

    wapdat Newbie

      Hi
      This is something I discovered with Struts in porting our applications in a standalone tomcat 4.1.27 to the tomcat 5 embedded in JBoss 3.2.5

      What I found is that if the resources are in the ~WEB-INF/classes directory (mine were in ~WEB-INF/classes/resources/ApplicationResources.properties) these would not be found when org.apache.struts.action.ActionServlet.parseModuleConfigFile() tried to load the application resources.

      Struts is trying to do this:

      URL url = getServletContext().getResource(path);
       InputSource is = new InputSource(url.toExternalForm());


      I found if I put the resources in a jar in ~WEB-INF/lib they were loaded fine inside JBoss.

      Struts was able to find the resources in the classes dir in a standalone Tomvcat 4.1.27 but not in JBoss 3.2.5

      I had a similar lesson when trying different class loaders in JBoss to load other property files (not in Struts). There must be something special about my setup as I'm surprised no one else reports similar issues.

      Hope this helps someone,
      Lindsay Smith