use URLCLassLoader For example Method method = null; method = Thread.class.getMethod("getContextClassLoader", null); return (ClassLoader) method.invoke(Thread.currentThread(), null);
urls = classLoader.getResources(resource); Properties p = new Properties(); p.load(url.openStream()); -----Original Message----- From: Rob Helmer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 6:05 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] loading properties files from a JAR on the classpath.. Hello, Sorry to put such a simple question to the list, but I haven't been able to figure this out.. I'm trying to load a properties file from a JAR that's in $JBOSS_HOME/server/default/lib I assumed that this directory was implicitly in the classpath for anything deployed in $JBOSS_HOME/server/default/deploy, however that does not seem to be the case. I wrote a little testcase loader.war that goes into deploy/, and loader.jar that goes into lib/. The only way I can get loader to load the test.prop inside loader.jar is to edit the run.sh and put $JBOSS_HOME/server/default/lib/loader.jar on the classpath explicitly. However, I'd like to avoid editing the run.sh .. how am I supposed to be doing this ? :) Thanks, Rob ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user