The Restlet JAX-RS implementation throws an exception for the following when
a POST request is performed against it. As far as I can see from the spec
this should be allowed. If the @Context is omitted then a 415 response is
returned instead.

@POST
@Path("/a/path")
public Response post(@Context HttpServletRequest request)

Jan 27, 2009 9:35:27 AM
org.restlet.ext.jaxrs.internal.wrappers.ResourceClass
initResourceMethodsAndLocators
WARNING: Ignore method public javax.ws.rs.core.Response
ca.bc.gov.bpf.cxf.BpfService.postJob(javax.servlet.http.HttpServletRequest):
An annotated parameter of the resource method public
javax.ws.rs.core.Response
ca.bc.gov.bpf.cxf.BpfService.postJob(javax.servlet.http.HttpServletRequest)
is has an illegal type
org.restlet.ext.jaxrs.internal.exceptions.IllegalMethodParamTypeException:
interface javax.servlet.http.HttpServletRequest must not be annotated with
@Context
    at
org.restlet.ext.jaxrs.internal.wrappers.params.ContextInjector.getInjectObject(ContextInjector.java:303)
    at
org.restlet.ext.jaxrs.internal.wrappers.params.ParameterList.<init>(ParameterList.java:917)
    at
org.restlet.ext.jaxrs.internal.wrappers.params.ParameterList.<init>(ParameterList.java:1046)
    at
org.restlet.ext.jaxrs.internal.wrappers.AbstractMethodWrapper.<init>(AbstractMethodWrapper.java:107)
    at
org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod.<init>(ResourceMethod.java:140)
    at
org.restlet.ext.jaxrs.internal.wrappers.ResourceClass.initResourceMethodsAndLocators(ResourceClass.java:384)
    at
org.restlet.ext.jaxrs.internal.wrappers.ResourceClass.<init>(ResourceClass.java:159)
    at
org.restlet.ext.jaxrs.internal.wrappers.RootResourceClass.<init>(RootResourceClass.java:131)
    at
org.restlet.ext.jaxrs.internal.wrappers.PerRequestRootResourceClass.<init>(PerRequestRootResourceClass.java:73)
    at
org.restlet.ext.jaxrs.internal.wrappers.ResourceClasses.getRootClassWrapper(ResourceClasses.java:227)
    at
org.restlet.ext.jaxrs.internal.wrappers.ResourceClasses.addRootClass(ResourceClasses.java:102)
    at org.restlet.ext.jaxrs.JaxRsRestlet.addClass(JaxRsRestlet.java:256)
    at org.restlet.ext.jaxrs.JaxRsApplication.add(JaxRsApplication.java:194)
    at org.restlet.ext.jaxrs.JaxRsApplication.add(JaxRsApplication.java:142)

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1059669

Reply via email to