1
votes

i am facing issues while deploying CXF base restful services into oracle weblogic server. The error i am getting is "The ResourceConfig instance does not contain any root resource classes".

I deployed as a war application, that contents only service definitions. it runs fine (other could use the service when its deployed in tomcat, but getting "The ResourceConfig instance does not contain any root resource classes" error when deploying to oracle weblogic server. I tried all the options (creating a ear and specifying prefer-application-packages option in weblogic-application.xml etc). Please let me know there is anyother configuration i need to do to get rid of the error.

Error Stacktrace:

The ResourceConfig instance does not contain any root resource classes.>

SEVERE: Missing dependency for method public void org.apache.cxf.jaxrs.provider.RequestDispatcherProvider.setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext) at parameter at index 1 SEVERE: Missing dependency for method public void org.apache.cxf.jaxrs.provider.JAXBElementProvider.setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext) at parameter at index 1 SEVERE: Missing dependency for field: private org.apache.cxf.jaxrs.ext.MessageContext org.apache.cxf.jaxrs.provider.MultipartProvider.mc SEVERE: Missing dependency for method public void org.apache.cxf.jaxrs.provider.AbstractCachingMessageProvider.setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext) at parameter at index 3 SEVERE: Missing dependency for method public void org.apache.cxf.jaxrs.provider.AbstractCachingMessageProvider.setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext) at parameter at index 3>

com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. at com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:99) at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1331) at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:168) at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:774) at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:770) Truncated. see log file for complete stacktrace

1
Have you updated init-param like here: mkyong.com/webservices/jax-rs/…Display Name is missing
I have resolved the issue myself, as i have specified the app ran fine in Tomccat, with weblogic only i had problem.user2985038
Web.xml is the one which was causing issue: <web-appxmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns="java.sun.com/xml/ns/javaee" xmlns:web="java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="java.sun.com/xml/ns/javaee java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> As you can see in the web.xml, web namespace is referring to web-app_2_5.xsd and schemaLocation points to web-app_3_0.xsd.After I correct schemaloc to web-app_2_5.xsd the web-app is running fine.user2985038
If you want you can post that as an answer to your own question rather than a comment so other users know it has been answeredDisplay Name is missing

1 Answers

1
votes

Web.xml is the one which was causing issue: I had this in my web.xml As you can see in the web.xml, web namespace is referring to web-app_2_5.xsd and schemaLocation points to web-app_3_0.xsd.After I correct schema location to web-app_2_5.xsd the web-app is running fine