0 Replies Latest reply on Jul 26, 2002 11:51 AM by rmchan

    ServletContext.getResourceAsStream fails - classloader issue

    rmchan

      Hi,

      I'm seeing some classloader weirdness occurring with Jboss3.0-tomcat4.0.3.

      I'm using a servlet which loads a property file contained within it's WEB-INF/classes directory. This works fine with the jboss 2.x-tomcat releases, but fails in 3.0. The call that is really failing is ServletContext.getResourceAsStream . I did some quick tracing and discovered, that I can get my code to work by use the this.getClass.getResourceAsStream() method, but shouldn't the servletContext.getResourceAsStream work also?

      What gives?


      FYI: this is under alinux debian (stable) environment, using sun jdk 1.4.01. (I've also tried it under with an IBM 1.3 vm).

      Also note, that the same war deploys fine under a straight catalina environment (ie/ without jboss), and the servletContext.getResourceAsStream works there as expected.