Why does ClassNotFoundException occur while accessing EJB through Proxy object?
Issue
-
We are performing
migrationfrom communityJBoss AS 5.1.0 GAtoEAP JBoss EAP 5.2.0. In our application, we have an applet application TEST which get connected to our application. -
While doing some transaction activity we faced below mentioned exception in
server.log;
Exception :ServiceHandlerServlet2 :callEJB :
com.sun.proxy.$Proxy8471 from BaseClassLoader@691d75c0{vfsfile:/data/jboss-eap-5.2/jboss-as/server/default/deploy/myApp.ear/}
2015-03-25 15:38:35,831 ERROR [STDERR] (http-0.0.0.0-80-1) java.lang.ClassNotFoundException: com.sun.proxy.$Proxy8471 from BaseClassLoader@691d75c0{vfsfile:/data/jboss-eap-5.2/jboss-as/server/default/deploy/myApp.ear/}
- Below is our code snippet which is being used to access
EJBclasses by using Proxy.
String lookUpName = "someLookUpName";
ActionHandlerRemote actionHandlerComp = (ActionHandlerRemote)ctx.lookup(lookUpName); //Some base class to get class details using lookup object
classObj = Class.forName(actionHandlerComp.getClass().getName()); // Trying to access EJB using proxy component created via lookup
- Following exception will be thrown while
EJBcomponents will be accessed viaProxy object.
2015-03-25 15:38:35,831 ERROR [STDERR] (http-0.0.0.0-80-1) java.lang.ClassNotFoundException: com.sun.proxy.$Proxy8471 from BaseClassLoader@691d75c0{vfsfile:/data/jboss-eap-5.2/jboss-as/server/default/deploy/myApp.ear/}
2015-03-25 15:38:35,831 ERROR [STDERR] (http-0.0.0.0-80-1) at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:481)
2015-03-25 15:38:35,831 ERROR [STDERR] (http-0.0.0.0-80-1) at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
2015-03-25 15:38:35,832 ERROR [STDERR] (http-0.0.0.0-80-1) at java.lang.Class.forName0(Native Method)
2015-03-25 15:38:35,832 ERROR [STDERR] (http-0.0.0.0-80-1) at java.lang.Class.forName(Class.java:171)
Environment
- Red Hat JBoss Enterprise Application Platform
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.