Try using ClassLoader.getResourceAsStream() instead of ClassLoader.getSystemResourceAsStream().
The method you are using says "go use the system class loader", and bypasses
any resources that are in your jar file under WEB-INF/lib.
Craig McClanahan
Juergen Baumann wrote: I try to load files in an InputStream (using ClassLoader) in the init() method of a Servlet that is loaded on startup. The files reside in a .jar file that contains all the classes as well.Using ClassLoader works fine in a stand-alone application, however, as soon as I try to make it work together with Tomcat using Servlets, I get the message: cannot load Servlet: ...Here is the relevant code. Thanks a lot in advance,JB init() method of Servlet:-------------------------...try { |
- Classloader issue Juergen Baumann
- RE: ClassLoader issue Craig R. McClanahan
- RE: ClassLoader issue Cox, Charlie
- Re: ClassLoader issue Ola Berg