Answer the question
In order to leave comments, you need to log in
Why can't it find the class?
In general, I want to generate a derived class using javassist
ClassPool pool = ClassPool.getDefault();
pool.appendClassPath(new LoaderClassPath(new UrlClassLoader( .... )));
CtClass cc = pool.makeClass("com.example.AppInfoServiceImpl", pool.getCtClass("com.example.AppInfoProto$AppInfoService"));
//..... generate methods
cc.toClass();
new UrlClassLoader( .... ).loadClass("com.example.AppInfoProto$AppInfoService")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question