The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)

20120419

Error getting reflective information for class X with ClassLoader Module, ClassNotFoundException: Y

i would get this error when i started my jboss 7 in debug mode in eclipse indigo:
11:02:38,727 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.subunit."myapp.ear"."richfaceswebapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapp.ear"."richfaceswebapp.war".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "richfaceswebapp.war" of deployment "myapp.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: java.lang.RuntimeException: Error getting reflective information for class com.myapp.richfacesweb.tabledatahandlers.transportrequestlist.TransportRequestDataModel with ClassLoader ModuleClassLoader for Module "deployment.myapp.ear.richfaceswebapp.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.NoClassDefFoundError: LUIDataTable;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_26]
at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_26]
at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_26]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: UIDataTable from [Module "deployment.myapp.ear.richfaceswebapp.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 15 more
even though class X (TransportRequestDataModel) which called class Y (UIDataTable) were positioned correctly in the war hierarchy:
* richfaceswebapp.war/WEB-INF/classes/com/myapp/richfacesweb/tabledatahandlers/transportrequestlist/TransportRequestDataModel

* richfaceswebapp.war/WEB-INF/lib/richfaces-components-ui-4.2.1.Final.jar

i finally found out that i was getting the error because i had upgraded from richfaces 4.2.0.Final to 4.2.1.Final and i hadn't changed the build path in eclipse, so all i needed to do was edit the .classpath file to make sure it pointed to the correct jar version, i.e. 4.2.1.Final:

<classpathentry kind="lib" path="WebContent/WEB-INF/lib/richfaces-components-api-4.2.1.Final.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/richfaces-components-ui-4.2.1.Final.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/richfaces-core-api-4.2.1.Final.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/richfaces-core-impl-4.2.1.Final.jar"/>

1 comment:

  1. I had the same problem, it turned out that I had two external services with the same method name (not the same signature). I changed the name of one.. now it works

    ReplyDelete