java - SEVERE: Missing dependency for field : private org.glassfish.jersey.server.wadl.WadlApplicationContext -
can me .. ? m trying create web service jax-rs gives me exception :
severe: missing dependency field: private org.glassfish.jersey.server.wadl.wadlapplicationcontext
org.glassfish.jersey.server.wadl.internal.wadlresource.wadlcontext
here java classe's code:
@path("/datajson") public class ressources { @get @produces(mediatype.application_json) public response test(){ string result = "@produces(\"application/json\") output: \n\nf c converter output: \n\n test succesful"; return response.status(200).entity(result).build(); } }
--- web.xml part :
<servlet> <servlet-name>jersey web application</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> </servlet> <servlet-mapping> <servlet-name>jersey web application</servlet-name> <url-pattern>/ws/*</url-pattern> </servlet-mapping>
---- jar used :
- javax.annotation-api-1.2.jar
- javax.ws.rs-api-2.0.jar
- jersey-bundle-1.17.jar
- jersey-client-2.0.jar
- jersey-common-2.0.jar
- jersey-container-servlet.jar
- jersey-multipart-1.14.jar
- jersey-server-2.0.jar
- json.jar
- mimepull-1.9.jar
- asm-3.3.1.jar
----- , exception have :
severe: missing dependency field: private org.glassfish.jersey.server.wadl.wadlapplicationcontext org.glassfish.jersey.server.wadl.internal.wadlresource.wadlcontext août 23, 2013 5:30:52 pm org.apache.catalina.core.applicationcontext log grave: standardwrapper.throwable com.sun.jersey.spi.inject.errors$errormessagesexception @ com.sun.jersey.spi.inject.errors.processerrormessages(errors.java:170) @ com.sun.jersey.spi.inject.errors.postprocess(errors.java:136) @ com.sun.jersey.spi.inject.errors.processwitherrors(errors.java:199) @ com.sun.jersey.server.impl.application.webapplicationimpl.initiate(webapplicationimpl.java:770) @ com.sun.jersey.server.impl.application.webapplicationimpl.initiate(webapplicationimpl.java:765) @ com.sun.jersey.spi.container.servlet.servletcontainer.initiate(servletcontainer.java:489) @ com.sun.jersey.spi.container.servlet.servletcontainer$internalwebcomponent.initiate(servletcontainer.java:319) @ com.sun.jersey.spi.container.servlet.webcomponent.load(webcomponent.java:605) @ com.sun.jersey.spi.container.servlet.webcomponent.init(webcomponent.java:210) @ com.sun.jersey.spi.container.servlet.servletcontainer.init(servletcontainer.java:374) @ com.sun.jersey.spi.container.servlet.servletcontainer.init(servletcontainer.java:557) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1206) @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:827) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:129) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:191) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:127) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293) @ org.apache.coyote.http11.http11processor.process(http11processor.java:859) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:602) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:489) @ java.lang.thread.run(thread.java:722) août 23, 2013 5:30:52 pm org.apache.catalina.core.standardwrappervalve invoke grave: exception lors de l'allocation pour la servlet jersey web application com.sun.jersey.spi.inject.errors$errormessagesexception @ com.sun.jersey.spi.inject.errors.processerrormessages(errors.java:170) @ com.sun.jersey.spi.inject.errors.postprocess(errors.java:136) @ com.sun.jersey.spi.inject.errors.processwitherrors(errors.java:199) @ com.sun.jersey.server.impl.application.webapplicationimpl.initiate(webapplicationimpl.java:770) @ com.sun.jersey.server.impl.application.webapplicationimpl.initiate(webapplicationimpl.java:765) @ com.sun.jersey.spi.container.servlet.servletcontainer.initiate(servletcontainer.java:489) @ com.sun.jersey.spi.container.servlet.servletcontainer$internalwebcomponent.initiate(servletcontainer.java:319) @ com.sun.jersey.spi.container.servlet.webcomponent.load(webcomponent.java:605) @ com.sun.jersey.spi.container.servlet.webcomponent.init(webcomponent.java:210) @ com.sun.jersey.spi.container.servlet.servletcontainer.init(servletcontainer.java:374) @ com.sun.jersey.spi.container.servlet.servletcontainer.init(servletcontainer.java:557) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1206) @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:827) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:129) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:191) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:127) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293) @ org.apache.coyote.http11.http11processor.process(http11processor.java:859) @ org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:602) @ org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:489) @ java.lang.thread.run(thread.java:722)
seems missing init param, specify package search annotated ws resources.
<servlet> <servlet-name>jersey web application</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>package.to.your.class</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey web application</servlet-name> <url-pattern>/ws/*</url-pattern> </servlet-mapping>
Comments
Post a Comment