settimer [https://community.jboss.org/people/settimer] created the discussion

"Interaction of javassist and 
java.lang.instrument.Instrumentation.appendToBootstrapClassLoaderSearch(JarFile)"

To view the discussion, visit: https://community.jboss.org/message/771995#771995

--------------------------------------------------------------
Inside "public static void premain(String agentArgs, Instrumentation inst)", I 
invoked "appendToBootstrapClassLoaderSearch(myJar)" to add myJar into the 
search path of the bootstrap classloader.

Java reflection code like "Class theClass = Class.forName("myclass");" 
succeeded, while myclass is a class contained in myJar, while 
"ClassPool.getDefault().get("myclass")" incurs javassist.NotFoundException.

Similarly, CtClass.insertBefore("some code refers to myclass") incurs 
"javassist.CannotCompileException: [source error] no such class". (I guess it 
is due to the same reason as above.)

Does it imply that the appendToBootstrapClassLoader has no effect on the search 
path of the default class pool? But the default class pool uses the system 
class loader to resolve a class, which includes the bootstrap search path, 
right?

Thanks!
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/771995#771995]

Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2062]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to