2
votes

I am following a tutorial that shows how to setup JAX-RS. However, I am getting an error when I reach a certain part in the tutorial.

The tutorial is here: http://www.youtube.com/watch?v=on557289GzA&feature=related

At one stage it says to perform the following:

Click Properties -> Click Project Facets -> Click JAX-RS(REST Web Service) -> Click further configuration -> Click OK

I then click apply, in the tutorial this should then generate the relevant files, however in my implementation I get the following error:

cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Exception while loading the app : java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.%%%EOL%%%

I am using a "GlassFish Server Open Source Edition 3 (Java EE 6)" and "Java 1.6.0.22".

Any help in solving this problem would be appreciated.

2
GlassFish should already contain JAX-RS as part of Java EE 6.user647772

2 Answers

0
votes

I was having the exact same problem and it was solved using this answer from a similar question from this question (The ResourceConfig instance does not contain any root resource classes)

0
votes

The issue may be with your web.xml file (mine was when I had a similar error), make sure that your servlet is setup looking like this:

<servlet>  
    <display-name>JAX-RS REST Servlet</display-name>  
    <servlet-name>JAX-RS REST Servlet</servlet-name>  
    <servlet-class>  
        com.sun.jersey.spi.container.servlet.ServletContainer  
    </servlet-class>  
    <load-on-startup>1</load-on-startup>  
</servlet> 

If this does not help, please comment with further information on what the issue is (are the jar files being imported correctly for JAX-RS, or if it is a configuration issue)