dev@jersey.java.net

Re: Invalid media type

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Fri, 27 Jul 2007 13:08:12 +0200

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
>