First I want to say that javassist is a really great bytemanipulation framework and it works really really good. I use javassist in an OSGi environment to do some class enhancements in runtime with weaving hooks.
To get things working, especially with the ClassPool, I added to the ClassPool an own ClassLoader. Everything works fine except for two methods, both concerning annotations, namely:
"hasAnnotation" and "getAnnotation". If I use them, I always get ClassNotFoundExceptions. My workaround now is that do exactly the same like you do in javassist lib in my code to analyse the class and check for annotations. In that way it works.
So I assume that this both methods don't use the added ClassLoader. Could that be?