I am seeing following exception when I try to use dynamic proxy
com.intellij.rt.execution.application.AppMain DynamicProxy.DynamicProxy
Exception in thread
When your DynamicProxy
tries to do Class.forName(youInterfaceClass.getName())
the resulting java.lang.Class
instance is different from the one you passed when you created the proxy. In other words you have two class objects with the same name and the proxy is not sure which one is the right one (doesn't matter whether they are the same).
Usually, this happens when the interface you are trying to proxy is in a library loaded through two different classloaders (i.e. Tomcat's 'common' and 'application').
If this doesn't help, please post more info on your application - especially if you are using any application server, Spring or OSGi.