get CtClass using specific ClassLoader
问题 I have a class structure like this: package com.mydomain.myproject; public class Outer{ public class Inner{ //some code } } Now, I can get a CtClass of the inner class using: ClassPool pool=ClassPool.getDefault(); CtClass innerCt=pool.getCtClass("com.mydomain.myproject.Outer$Inner"); The problem occurs if those classes are loaded by a special ClassLoader . ClassPool#getCtClass fails because the ClassLoader it uses doesn't know of the class. I get the following exception: javassist