Shark, Eclipse and the ClassLoader
Josh Zeidner <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.shark |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am currently trying to develop a simple application in Eclipse that
uses Shark. My app has one line:
org.enhydra.shark.Shark.configure( "conf/Shark.conf" );
This causes a nullPointerException when this code executes:
URL u=Shark.class.getClassLoader().getResource("Shark.conf.forJar");
because for some reason, the code tries to load the default .conf file
located in the .jar file even though I am supplying my own Shark.conf
file. The problem is that the getClassLoader() function returns null.
Sun offers some useful info:
******************************************
getClassLoader
public ClassLoader <http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html> *getClassLoader*()
Returns the class loader for the class. Some implementations may use
null to represent the bootstrap class loader. This method will return
null in such implementations if this class was loaded by the bootstrap
class loader.
******************************************
So when I use Eclipse, the getClassLoader() function returns null and
throws a fatal exception, but I can run Shark from the standard .bat
files. Any ideas? Anyone using Eclipse + Shark?
Thanks, Josh Zeidner
message-footer.txt
(text/plain, 271 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws