Thanks Sergey! I'll try and test it out in OODT in the next few weeks. Cheers, Chris
On Jan 24, 2011, at 2:46 PM, Sergey Beryozkin wrote: > This is fixed now. CXF 2.3.3 may need to be released soon so the fix will be > there. A workaround (providing for both MultivaluedMap and explicit Form > parameters in the same signature) is possible even now but it's really a > hack so it's better to wait till 2.3.3 :-) > > Thanks, Sergey > > On Mon, Jan 24, 2011 at 1:37 AM, Mattmann, Chris A (388J) < > [email protected]> wrote: > >> Thanks Sergey! >> >> I've worked around it for now in OODT-118, but would love to be able to >> switch the code back to the way that it was! >> >> Cheers, >> Chris >> >> On Jan 23, 2011, at 10:02 AM, Sergey Beryozkin wrote: >> >>> Hi Chris >>> >>> On Sun, Jan 23, 2011 at 1:59 AM, Mattmann, Chris A (388J) < >>> [email protected]> wrote: >>> >>>> Hi Folks, >>>> >>>> Was trying to find someone in IRC, but going to post this to the list >> too >>>> I'm using JAX RS from CXF, with the 2.3.2 jars within Apache OODT. We've >>>> seen an error in one of our webapps over there that seems to be what >> this >>>> user was reporting: >>>> >>>> http://osdir.com/ml/users-cxf-apache/2009-05/msg00166.html >>>> >>>> I've filed an OODT issue about this: >>>> >>>> https://issues.apache.org/jira/browse/OODT-118 >>>> >>>> Basically what I'm seeing is that I have a JAX RS service mapped to >>>> /services/metadata/catalog the method looks like this: >>>> @POST >>>> @Path(CATALOG) >>>> @Consumes("application/x-www-form-urlencoded") >>>> @Produces("text/plain") >>>> public String setCatalogMetadata(MultivaluedMap<String, String> >>>> formParams, >>>> @FormParam("id") String id) { >>>> >>>> What i'm seeing is an error where id is always null. I threw up firebug >>>> and confirmed that id is getting passed in correctly via the form >> params. >>>> >>>> >>> What is likely happening is that all the form parameters are consumed >> from >>> the request input stream by the formParams map. The "formParams" >> parameter >>> represents a request body (it has no JAX-RS annotations associated with >> it) >>> and thus the JAX-RS runtime uses a form MessageBodyReader. This reader is >>> not aware of the fact that another method parameter is referring to one >> of >>> the form names in the request body and 'drains' the stream. >>> >>> I'll look into it. Perhaps this issue can be easily resolved by having >> the >>> form reader to persist the MultivaluedMap<String, String> map on the >> current >>> message, something similar to what is used to have multiple FormParams >>> supported >>> >>> thanks, Sergey >>> >>> Any ideas? You can see the OODT code for yourself around line 260 in this >>>> file: >>>> >>>> http://s.apache.org/eEE >>>> >>>> Cheers, >>>> Chris >>>> >>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>>> Chris Mattmann, Ph.D. >>>> Senior Computer Scientist >>>> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA >>>> Office: 171-266B, Mailstop: 171-246 >>>> Email: [email protected] >>>> WWW: http://sunset.usc.edu/~mattmann/<http://sunset.usc.edu/%7Emattmann/> >> <http://sunset.usc.edu/%7Emattmann/> >>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>>> Adjunct Assistant Professor, Computer Science Department >>>> University of Southern California, Los Angeles, CA 90089 USA >>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >>>> >>>> >> >> >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> Chris Mattmann, Ph.D. >> Senior Computer Scientist >> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA >> Office: 171-266B, Mailstop: 171-246 >> Email: [email protected] >> WWW: http://sunset.usc.edu/~mattmann/<http://sunset.usc.edu/%7Emattmann/> >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> Adjunct Assistant Professor, Computer Science Department >> University of Southern California, Los Angeles, CA 90089 USA >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Chris Mattmann, Ph.D. Senior Computer Scientist NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 171-266B, Mailstop: 171-246 Email: [email protected] WWW: http://sunset.usc.edu/~mattmann/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Adjunct Assistant Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
