Reputation: 6292
I have got a restful service written using restEasy and deployed to JBoss. I have got a web.xml defiled as:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>Web Application</display-name>
<listener>
<listener-class>org.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<listener>
<listener-class>org.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
However, when I deploy this war file, it produces error message:
20:06:46,225 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."orderservice-develop
er.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."orderservice-developer.war".POST_MODULE: Failed to process
phase POST_MODULE of deployment "orderservice-developer.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0
.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.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011093: Could not load component class org.resteasy.plugins.server.se
rvlet.ResteasyBootstrap
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:113)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0
.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.resteasy.plugins.server.servlet.ResteasyBootstrap from [Module "deployment.orderservice-developer.war
:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:111)
... 7 more
It looks like it cannot find the class "org.resteasy.plugins.server.servlet.ResteasyBootstrap". Actually I have digged into all my jar files deployed inside the war file and found this class inside "resteasy-jaxrs-2.3.1.GA".
How come this class cannot be picked up? Is there anything wrong with my web.xml?
Upvotes: 1
Views: 9158
Reputation: 2133
It should be:
<listener-class>org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>
and not:
<listener-class>org.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>
In the documentation it is defined wrong.
Upvotes: 2
Reputation: 80603
JBoss 7 comes with RESTEasy (mostly) integrated. By including your own resteasy-jaxrs-2.3.1.GA
version you are almost certainly inducing conflicts. You also do not need any of the RESTEasy servlets in your web.xml, the module is automatically loaded by JBoss 7 now.
Upvotes: 0