Sunday, February 2, 2014

Currently running some webapps on Jboss AS 4/5 and I am testing migration to jboss7. When I try to deploy a jersey based webapp on JBoss AS 7 (full profile with standalone-preview config file), I get:
org.jboss.as.server.deployment.DeploymentUnitProcessingException: Only one JAX-RS Application Class allowed.
I've done a bit of hunting around on it and found that RestEasy is the default JAX-RS implementation embedded into Application Server. Posts like http://community.jboss.org/message/579996 andhttps://issues.jboss.org/browse/JBAS-8830) mention that the RestEasy deployer takes over.
In AS 6, it seems easier to remove the deployer whereas I have not seen any solutions for AS 7.
share|improve this question
add comment

8 Answers

up vote24down voteaccepted
it has already been mentioned in this post : https://community.jboss.org/message/744530#744530 , you can just ask the resteasy module to not scan for other JAX RS implementations in your webapp; just add this to your web.xml :

    resteasy.scan
false resteasy.scan.providers false resteasy.scan.resources false
worked fine for me
share|improve this answer
 
Worked! Very simple and good answer! –  Vinicius May 14 '13 at 21:45
 
Worked for me as well! A bit sad the web.xml contains now some specific JBoss configuration. I preferred to get it working by modifying the jboss-deployment-structure.xml, but that didn't work out. –  Esk May 22 '13 at 15:05
 
it sounds like a bug of jboss.. i also wouldnt like to modify my web.xml but seems that there is no other option–  thiagoh Oct 2 '13 at 23:52
add comment
Besides removing the entire jaxrs subsystem in standalone.xml as mentioned in the other posts excluding the RESTEasy modules in jboss-deployment-structure.xml may also work.
 xmlns="urn:jboss:deployment-structure:1.0">
  
    
       name="org.jboss.resteasy.resteasy-atom-provider" />
       name="org.jboss.resteasy.resteasy-cdi" />
       name="org.jboss.resteasy.resteasy-jaxrs" />
       name="org.jboss.resteasy.resteasy-jaxb-provider" />
       name="org.jboss.resteasy.resteasy-jackson-provider" />
       name="org.jboss.resteasy.resteasy-jsapi" />
       name="org.jboss.resteasy.resteasy-multipart-provider" />
       name="org.jboss.resteasy.async-http-servlet-30" />
    
Also check out
share|improve this answer
add comment

No comments: