Sunday, July 24, 2016

Error getting reflective information for class org.springframework.web.servlet.DispatcherServlet

Hi Guys ,
You might experience Error getting reflective information for class org.springframework.web.servlet.DispatcherServlet error while deploying any spring MVC project to wildfly.

Full stack trace is as below:


12:37:48,987 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."org.myProject.question.model.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."org.myProject.question.model.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "org.myProject.question.model.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_91]
Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class org.springframework.web.servlet.DispatcherServlet with ClassLoader ModuleClassLoader for Module "deployment.org.myProject.question.model.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:107)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:92)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 5 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.8.0_91]
at java.lang.Class.privateGetDeclaredFields(Class.java:2583) [rt.jar:1.8.0_91]
at java.lang.Class.getDeclaredFields(Class.java:1916) [rt.jar:1.8.0_91]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 10 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.request.async.CallableProcessingInterceptor from [Module "deployment.org.myProject.question.model.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
... 15 more

12:37:49,000 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "org.myProject.question.model.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"org.myProject.question.model.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"org.myProject.question.model.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"org.myProject.question.model.war\"
    Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class org.springframework.web.servlet.DispatcherServlet with ClassLoader ModuleClassLoader for Module \"deployment.org.myProject.question.model.war:main\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.request.async.CallableProcessingInterceptor from [Module \"deployment.org.myProject.question.model.war:main\" from Service Module Loader]"}}
12:37:49,065 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment org.myProject.question.model.war (runtime-name: org.myProject.question.model.war) in 65ms


You might have notices the  root cause is java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor

If you have the same root cause , you can try the following solutions that worked for me:
1. If you are using maven delete all the repositories , do a fresh clean install and deploy the war file again.
2. If you are using eclipse to add the project to wildfly , use wildfly admin console.

References :
SO



No comments:

Post a Comment

ec2-user@ec2 Permission denied