1 Reply Latest reply on Aug 31, 2002 3:51 PM by James Carman

    Classpath Question

    frank starsinic Newbie

      when i deploy me ear file (which deploys my war file)
      i check the classpath of tomcat using
      and display it in the log4j logfile while
      accessing a web page.

      among the items in the classpath are NOT the
      jar files that i added to the META-INF/lib
      in the war file.

      i am trying to do this...

      String pResource =
      URL url = ClassLoader.getSystemClassLoader().getResource(pResource);

      but the resource is not found.

      when i put the jar file into jboss itself, all was ok.
      it seems that actual .class files are found. just not the resources.

      i'm assumming that a resource can have any name and not xxxx.properties??


        • 1. Re: Classpath Question
          James Carman Newbie

          Why not put your resources in your webapp? You can use ServletContext.getResource() instead of the system classloader to load your resource. This way, your code is more portable and tightly packaged (IMHO). So, you could replace that line with...

          URL url = getServletContext().getResource( "/WEB-INF/scripts/CreateEfileEntity.js" );

          Hope this helps. :-)