-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tim,
On 3/7/2009 9:53 PM, Timothy Washington wrote:
> 'MyClass.class.getResourceAsStream("myresource.xml")'
You might have better luck using ServletContext.getResourceAsStream, if
you have access to the ServletContext.
Check out the javadoc for this
spotted that and b) you aren't
still messsing with classpath variables.
p
> Tim
>
>
>
> ________
> From: Pid
> To: Tomcat Users List
> Sent: Sunday, March 8, 2009 10:13:58 AM
> Subject: Re: java.lang.NullPointerException loading resource from classp
7;MyClass.class.getResourceAsStream("/myresource.xml") - working
now!!
Thanks for the feedback
Tim
From: Pid
To: Tomcat Users List
Sent: Sunday, March 8, 2009 10:13:58 AM
Subject: Re: java.lang.NullPointerException loading resource from classpath
T
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 approac
Nope!!! I lied, it's still not working in tomcat 4 :|
tim
From: Timothy Washington
To: Tomcat Users List
Sent: Saturday, March 7, 2009 10:19:16 PM
Subject: Re: java.lang.NullPointerException loading resource from classpath
Update:
I tried this weba
Update:
I tried this webapp in 'apache-tomcat-4.1.39-LE-jdk14' and the code in question
works fine. So my question is what happened to tomcat 5 and after that makes
resource loading so difficult?
It's a very simple call to
'MyClass.class.getResourceAsStream("myresource.xml")' and the resourc