2015-10-27 6 views
0

Я получаю эту ошибку, когда я пытаюсь получить этот отдых услугу:Resteasy Exception; Исключение отправки контекст инициализация события слушателя экземпляра класс ResteasyBootstrap

JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: RESTEASY001745: Unable to find a public constructor for class org.jboss.resteasy.core.AsynchronousDispatcher

Я использую JBoss 6.4, я не могу видеть, что производить это ошибка, кажется, все нормально. Есть идеи?

Услуги Отдых:

@Path("/message") 
public class MessageService { 
    @GET 
    @Path("/{name}") 
    public Response getMessage(@PathParam("name") String name) { 
     String message = "Hello " + ((name != null) && (name.length() > 0) ? name : "anonymous"); 

     return Response.status(200).entity(message).build(); 
    } 
} 

web.xml:

<web-app id="WebApp_ID" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
<display-name>JAX-RS Example</display-name> 

<context-param> 
    <param-name>resteasy.scan</param-name> 
    <param-value>true</param-value> 
</context-param> 

<context-param> 
    <param-name>resteasy.servlet.mapping.prefix</param-name> 
    <param-value>/rest</param-value> 
</context-param> 

<listener> 
    <listener-class> 
     org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap 
    </listener-class> 
</listener> 

<servlet> 
    <servlet-name>resteasy-servlet</servlet-name> 
    <servlet-class> 
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher 
    </servlet-class> 
</servlet> 

<servlet-mapping> 
    <servlet-name>resteasy-servlet</servlet-name> 
    <url-pattern>/rest/*</url-pattern> 
</servlet-mapping> 

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.wordpress.infow</groupId> 
<artifactId>jaxrs</artifactId> 
<version>1.0</version> 
<packaging>war</packaging> 
<name>jaxrs</name> 
<url>http://www.infow.wordpress.com</url> 

<repositories> 
    <repository> 
     <id>JBoss repository</id> 
     <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url> 
    </repository> 
</repositories> 

<dependencies> 
    <dependency> 
     <groupId>org.jboss.resteasy</groupId> 
     <artifactId>resteasy-jaxrs</artifactId> 
     <version>2.3.6.Final</version> 
    </dependency> 
</dependencies> 

Трассировка ошибки:

17:40:42,459 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/TestRestFull]] (ServerService Thread Pool -- 95) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: RESTEASY001745: Unable to find a public constructor for class org.jboss.resteasy.core.AsynchronousDispatcher 
at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.registered(POJOResourceFactory.java:36) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:119) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:105) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:82) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:71) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:378) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:233) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) [resteasy-jaxrs-2.3.10.Final-redhat-1.jar:] 
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1] 
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] 
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] 
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_45] 
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45] 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45] 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45] 
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45] 
at org.jboss.threads.JBossThread.run(JBossThread.java:122) 

ответ

4

Попробуйте изменить сферу ваших зависимостей Resteasy в условии. resteasy уже связан с JBoss, поэтому проблема может быть вызвана столкновением версий или чем-то подобным.

+0

works !, thanks mendieta – Miofino

+0

Вы очень желанны! – mendieta

+1

Спасибо @mendieta, что вы напомнили мне суперзвездную звезду, Гайцку Мендиету :)) –