Hi all,
A big thanks for this amazing little library of code. I am a developer with the babeldoc project: www.babeldoc.com. And I am trying to get the webserver/appserver that is built into javassist to run on tomcat. I am having some issues with ClassPool finding my classes:
in the servlet getPost:
logging("Method 1");
Class clazz = Class.forName(classname);
logging("Classloader: "+Thread.currentThread().getContextClassLoader().getClass().toString());
logging("Method 2");
CtClass ctclazz = classPool.get(classname);
In response the ClassPool is throwing this exception:
AppServer: Finding class: com.babeldoc.web.server.CountApplet
AppServer: Method 1
AppServer: Classloader: class org.apache.catalina.loader.WebappClassLoader
AppServer: Method 2
javassist.NotFoundException: com.babeldoc.web.server.CountApplet
at javassist.ClassPoolTail.openClassfile(ClassPoolTail.java:270)
at javassist.ClassPoolTail.checkClassName(ClassPoolTail.java:175)
at javassist.ClassPool.checkClassName(ClassPool.java:652)
This is a classloader issue. The tomcat classloader is "hiding" the class from javassist. Now is there a way for me to work around this? The big problem that I have is that I dont want to write a tomcat specific fix - but rather a generic fix.
regards and thanks in advance,
Bruce McDonald.