Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ClassLoader.getSystemResource() returning null

807589Jul 10 2008 — edited Jul 10 2008
I have the following line of code:
URL schemaLocation = ClassLoader.getSystemResource("resources/Metrics.xsd");
I have the Metrics.xsd in a JAR in the folder resources.

When I run my app in java it works fine. When I run my app from ANT null is returned.
Does anyone know why this could be happening? Does ant use a different classloader? If so how can I make this work when I run from java -jar OR start the app through ANT?

Thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2008
Added on Jul 10 2008
1 comment
1,022 views