users@jersey.java.net

[Jersey] Servlet context injection fail while using jersey test framework

From: bbarodia <birenbarodia_at_gmail.com>
Date: Thu, 16 Jun 2011 11:54:01 -0700 (PDT)

Hi ,

I am using JerseyTest to test my webservices. It runs fine normally but
recently I had to change a signature to add the @Context injection since i
need to retrieve the servername. The webservice test fails and it gives the
following exception which i am not able to interpret.

Jun 16, 2011 2:24:55 PM com.sun.jersey.spi.inject.Errors
processErrorMessages
SEVERE: The following errors and warnings have been detected with resource
and/or provider classes:
  SEVERE: Missing dependency for method public
com.yahoo.sm.qatools.testmanager.ws.wsdatamisc.ResponseMessage
com.yahoo.sm.qatools.testmanager.admin.ws.resources.WebServiceResource.addViewer(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,javax.servlet.http.HttpServletRequest)
throws com.yahoo.sm.qatools.testmanager.admin.ws.WSValidationException at
parameter at index 5
  SEVERE: Method, public
com.yahoo.sm.qatools.testmanager.ws.wsdatamisc.ResponseMessage
com.yahoo.sm.qatools.testmanager.admin.ws.resources.WebServiceResource.addViewer(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,javax.servlet.http.HttpServletRequest)
throws com.yahoo.sm.qatools.testmanager.admin.ws.WSValidationException,
annotated with PUT of resource, class
com.yahoo.sm.qatools.testmanager.admin.ws.resources.WebServiceResource, is
not recognized as valid resource method.
com.sun.jersey.spi.inject.Errors$ErrorMessagesException
        at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:150)
        at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:117)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:183)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:649)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:644)
        at
com.yahoo.sm.qatools.testmanager.support.TestManagerInMemoryTestContainerFactory$InMemoryTestContainer.start(TestManagerInMemoryTestContainerFactory.java:144)

Thanx for the help.

--
View this message in context: http://jersey.576304.n2.nabble.com/Servlet-context-injection-fail-while-using-jersey-test-framework-tp6484324p6484324.html
Sent from the Jersey mailing list archive at Nabble.com.