users@jersey.java.net

Re: [Jersey] How to use _at_FormParam ?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 21 Aug 2008 14:59:30 +0200

I think you found a bug, try removing the @Context UriInfo field.

I am running some tests at the moment, once they have finished i will
investigate further.

Paul.


? Zimmermann wrote:
> I'm using the 0.9-ea snapshot of Aug. 20 and defined this method:
>
> @Path("/kunden")
> @POST
> @Consumes(APPLICATION_FORM_URLENCODED)
> @Produces
> public Response createKundeForm(@FormParam("nachname") String
> nachname,
> @FormParam("plz") String
> plz,
> @FormParam("ort") String
> ort,
> @FormParam("strasse")
> String strasse,
> @FormParam("hausnr")
> String hausnr,
> @Context UriInfo
> uriInfo)
> throws KundeCreateAdresseException,
> KundeDuplikatException {...}
>
> When (re-) starting the webapp inside Tomcat I get the following
> stacktrace.
> Any hint is appreciated!
>
> 21.08.2008 10:58:21 org.apache.catalina.core.ApplicationContext log
> SCHWERWIEGEND: StandardWrapper.Throwable
> com.sun.jersey.api.container.ContainerException: [failed to localize]
> not.valid.httpmethod(public javax.ws.rs.core.Response
> de.hska.kundenverwaltung.rest.KundenverwaltungResource.createKundeForm(j
> ava.lang.String,java.lang.String,java.lang.String,java.lang.String,java.
> lang.String,javax.ws.rs.core.UriInfo) throws
> de.hska.kundenverwaltung.KundeCreateAdresseException,de.hska.kundenverwa
> ltung.KundeDuplikatException, POST, class
> de.hska.kundenverwaltung.rest.KundenverwaltungResource)
> at
> com.sun.jersey.impl.model.method.ResourceHttpMethod.<init>(ResourceHttpM
> ethod.java:74)
> at
> com.sun.jersey.impl.model.ResourceClass.processSubResourceMethods(Resour
> ceClass.java:239)
> at
> com.sun.jersey.impl.model.ResourceClass.<init>(ResourceClass.java:113)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.newResourceClass(WebA
> pplicationImpl.java:294)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.getResourceClass(WebA
> pplicationImpl.java:265)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(
> WebApplicationImpl.java:796)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicati
> onImpl.java:668)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicati
> onImpl.java:485)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletCo
> ntainer.java:559)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContai
> ner.java:483)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContai
> ner.java:165)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
> a:1172)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
> ava:4058)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4371
> )
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109