I'm trying to run my REST service, but every now and then meet the same problem: Failed to process phase POST_MODULE of deployment "RestService.war"
My configuration: JDK 1.8.60, WildFly 9 (the same problem is with the 10th version), Jersey.servlet 2.22
Here are my resources:
The full text of error is below:
What is interesting, Tomcat 8.0 fails as well with this Rest and demonstrates the issue with invalid url pattern. However, it seems to me appropriately formed
Would be grateful for any help, since Rest services are not so REST for me any more.
The error is clear: class com.sun.jersey.spi.container.servlet.ServletContainer cannot be found. Either it's not in the dependency you're using, or it cannot be found for another reason.
Now some good news: this can be fixed really, really easy. Just remove all of the Jersey stuff. JBoss and WildFly come with their own REST implementation, RESTeasy. You don't even need to do anything to get it to work. Just have the @ApplicationPath class and your REST classes, and JBoss and WildFly will automatically pick them up.
Now, should you require some RESTeasy specifics, you can use the following dependencies (check out the actual versions for your JBoss/WildFly version):
org.jboss.resteasy:resteasy-jaxrs for the core
org.jboss.resteasy:resteasy-jackson-provider for a Jackson 1.x provider (for converting to and from JSON)
org.jboss.resteasy:resteasy-jackson2-provider for a Jackson 2.x provider
org.jboss.resteasy:resteasy-client for a RESTeasy client
You can find the versions and more libraries in your WildFly installation, sub folder modules/system/layers/base/org/jboss/resteasy.
Very important: mark these dependencies as provided, otherwise they may conflict with the JBoss/WildFly internal classes.