0 Replies Latest reply on Nov 15, 2012 11:51 AM by ezs

    Problem with RESTEasy 2.3.5.Final and JBoss AS 7.1

    ezs

      I'm using JBoss AS 7.1.x.incremental.1 "Steropes" and my application uses RESTEasy. According to RESTEasy documentation for 2.3.5 http://docs.jboss.org/resteasy/docs/2.3.5.Final/userguide/html/Installation_Configuration.html#d4e124, in order to use the latest version of RESTEasy with JBoss, JBoss needs to be patched by unzipping the resteasy-jboss-modules-2.3.5.Final.zip file in the JBoss modules directory. (Actually, the instructions say to unzip in the top level directory which contains modules, but that is a mistake and should be unzipped in the modules directory.) The problem is that before I applied the patch, everything worked using the built-in version of RESTEasy, 2.3.5.Final. After I unzipped this patch, I now get this error in JBoss:

       

      11:06:02,691 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.subunit [name of project ear removed]...

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.x.incremental.1.jar:7.1.x.incremental.1]

          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.6.0_22]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_22]

          at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_22]

      Caused by: java.lang.NoSuchMethodError: org.jboss.resteasy.util.GetRestful.getSubResourceClass(Ljava/lang/Class;)Ljava/lang/Class;

          at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:66)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.x.incremental.1.jar:7.1.x.incremental.1]

          ... 5 more

       

      11:06:02,900 INFO  [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "***.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"***.ear\".\"***.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"***.ear\".\"***.jar\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment \"***.jar\" of deployment \"***.ear\"

          Caused by: java.lang.NoSuchMethodError: org.jboss.resteasy.util.GetRestful.getSubResourceClass(Ljava/lang/Class;)Ljava/lang/Class;"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"***.ear\".\"***.war\".INSTALL Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.unit.\"***.ear\".INSTALL Missing[JBAS014861: <one or more transitive dependencies>]"]}

       

      Any ideas? I'm using Maven to build and deploy my application, but all RESTEasy dependencies have the "provided" scope so it is relying on JBoss to provide the jars. Has anyone else had this problem?

       

      BTW, instead of applying a patch, I'd much prefer to change the scope of the RESTEasy dependencies to "compile" so all neccessary jars are included in the ear deployment. However, if I do that, I get this error:

       

      javax.servlet.ServletException: Servlet.init() for servlet ***.restful.RestfulServicesApplication threw exception

      org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

      org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:156)

      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)

      java.lang.Thread.run(Thread.java:679)

      root cause

      java.lang.RuntimeException: Unable to find a public constructor for class org.jboss.resteasy.core.AsynchronousDispatcher

      org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.registered(POJOResourceFactory.java:35)

      org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:120)

      org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:106)

      org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)

      org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72)

      org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:367)

      org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:225)

      org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:67)

      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)

      org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

      org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:156)

      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679)

      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931)

      java.lang.Thread.run(Thread.java:679)

       

      Thanks!