This content has been marked as final.
Show 3 replies
-
1. Re: Runtime jar loading with JBoss 7.1.1 Final
sfcoy Apr 21, 2013 11:24 PM (in response to execretor)Have you read Class Loading in AS7?
-
2. Re: Runtime jar loading with JBoss 7.1.1 Final
execretor Apr 22, 2013 7:18 AM (in response to sfcoy)yes, but there is not my case.
I want to load a jar with this code,
URLClassLoader child = new URLClassLoader (myJar.toURL(), this.getClass().getClassLoader());
Class classToLoad = Class.forName ("com.MyClass", true, child);
Method method = classToLoad.getDeclaredMethod ("myMethod");
Object instance = classToLoad.newInstance ();
Object result = method.invoke (instance);
and not via manifest.
-
3. Re: Runtime jar loading with JBoss 7.1.1 Final
sfcoy Apr 22, 2013 10:07 AM (in response to execretor)§8.2.5 in the JEE6 spec ("Dynamic Class Loading") describes a technique for accessing the classloader that may work for your usecase.