users@jersey.java.net

[Jersey] Re: Media type parse error

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Mon, 6 Jun 2011 13:23:00 -0400

On Jun 6, 2011, at 10:46 AM, jonathan.lister_at_vaisala.com wrote:
> Code like this:
>
> @Produces({"text/xml; subtype=gml/3.1.1"})
> @Path("describeFeatureType")
> public Response describeFeatureType(@Context UriInfo uri) {
>
> Leads to a deployment time error on GlassFish 3.1:
>
> INFO: Initiating Jersey application, version 'Jersey: 1.5 01/14/2011 12:36 PM'
> SEVERE: WebModule[/jx-web-services]StandardWrapper.Throwable
> java.lang.IllegalArgumentException: java.text.ParseException: Expected separator ';' instead of '/'
> at com.sun.jersey.core.header.MediaTypes.createQualitySourceMediaTypes(MediaTypes.java:285)
> at com.sun.jersey.core.header.MediaTypes.createQualitySourceMediaTypes(MediaTypes.java:270)
>

 I believe you should use double quotes around gml/3.1.1 since "/" is a special char. The quotes should not be part of the value.

-- Santiago