dev@jersey.java.net

Re: Invalid media type

From: Fred <frederic.auguste_at_gmail.com>
Date: Fri, 27 Jul 2007 16:14:38 +0200

Thanks Julien,

The following content-type is working fine :
MediaTypeProvider mediaTypeProvider = new MediaTypeProvider();
mediaTypeProvider.fromString("multipart/form-data;
boundary=\"Thread:0000_at_Round:0001\"");

I'm using WebLoad, it generate this kind of content type :-(

Best regards,
Frédéric

2007/7/27, Jakub Podlesak <Jakub.Podlesak_at_sun.com>:
>
> Thanks Julian! I think it explains. The issue is on a client side.
> Only maybe Jersey could provide more specific error messages.
>
> ~Jakub
>
> On Fri, Jul 27, 2007 at 12:19:04PM +0200, Julian Reschke wrote:
> > Fred wrote:
> > >Yes, I have a [java.text.ParseException].
> > >
> > >You can reproduce this bug with the following code :
> > >MediaTypeProvider mediaTypeProvider = new MediaTypeProvider();
> > >mediaTypeProvider.fromString("multipart/form-data;
> > >boundary=Thread:0000_at_Round:0001");
> > >
> > >Stak trace :
> > >java.text.ParseException: Expected separator ';' instead of ':'
> > > at
> > > com.sun.ws.rest.impl.http.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:87)
> > > at
> > > com.sun.ws.rest.impl.http.header.reader.HttpHeaderReader.readParameters(HttpHeaderReader.java:215)
> > > at
> > > com.sun.ws.rest.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:73)
> > >
> > >Frédéric
> >
> > As far as I can tell, "Thread:0000_at_Round:0001" is not a legal parameter
> > value. Check
> >
> > <http://tools.ietf.org/html/rfc2045#section-5.1>
> >
> > parameter := attribute "=" value
> >
> > attribute := token
> > ; Matching of attributes
> > ; is ALWAYS case-insensitive.
> >
> > value := token / quoted-string
> >
> > token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
> > or tspecials>
> >
> > tspecials := "(" / ")" / "<" / ">" / "@" /
> > "," / ";" / ":" / "\" / <">
> > "/" / "[" / "]" / "?" / "="
> > ; Must be in quoted-string,
> > ; to use within parameter values
> >
> >
> > ":" is in "tspecials", thus may not appear in an unquoted parameter value.
> >
> > Best regards, Julian
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> > For additional commands, e-mail: dev-help_at_jersey.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>
>