This content has been marked as final.
Show 2 replies
-
1. Re: MBean and how to add to Classpath
berlinbrown Jan 23, 2005 9:33 PM (in response to berlinbrown)Anyway, right now, I have to add that particular jar file so that I can use a particular resource in it.
System.setProperty("java.class.path",
System.getProperty("java.class.path") + ":"); -
2. Re: MBean and how to add to Classpath
dimitris Jan 24, 2005 4:00 AM (in response to berlinbrown)This is not the right way to do it. JBoss has a very elaborate classloading system (see http://www.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases, you can't just modify the global JVM classpath!
If your resource is inside your service archive (e.g. at the root of it "myresource.xml") then simply asks the classloader who loaded your MBean class in the first place, e.g.:InputStream resource = new InputStreamReader(this.getClass().getResourceAsStream("myresource.xml"));
And BTW, if this is a service archive, it should be named .sar not .jar