Timothy Washington wrote:
>
> Hi there, I have what seems to be a very simple problem.
>
> I've deployed a web application to tomcat. But in the application, when I try
> to load a resource (an XML file), it comes back as null. This is very
> frustrating, because some of the most basic approaches are not working to
> give me my XML resource. I'm using the
> 'MyClass.class.getResourceAsStream("myresource.xml")' method, and I've tried
> the following:
> * placing the resource in i) WEB-INF/lib, ii) WEB-INF/classes
> * using tomcat versions i) 5.5.27 and ii) 6.0.18
> * setting the classpath in i) conf/catalina.properties ii) manually in
> bin/catalina.sh
Setting the classpath is a bad idea, don't do it.
Tomcat sets its own classpath & the classpath for individual web
applications, any tinkering you do is likely to produce unpredictable
conditions.
Place the resource in WEB-INF/classes and make sure your class has a
package definition. Let us know if that works.
p
> Can anyone help me here? This should be dead simple, so I feel like I'm
> missing something basic.
>
> Thanks
> Tim
>
>
>
> __________________________________________________________________
> Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo!
> Canada Messenger at http://ca.beta.messenger.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]