users@jersey.java.net

Configuration of default Entity Providers

From: Alex Treppass <alextreppass_at_googlemail.com>
Date: Tue, 25 May 2010 15:17:20 +0100

Jersey should enable the configuration of the default Entity Providers.

We have recently been having issues with the various XML*.General classes.
These classes claim to be able to correctly process application/atom+xml and
application/xaml+xml despite the fact that they clearly can’t.

In particular, IE has the really nasty trait of producing an accept header
that may include application/xaml+xml and */* but does not include
text/html. This means that when IE connects to a Jersey web service the
specific application/xaml+xml takes priority over the generic */* and the
web server “produces” application/xaml+xml.

Xaml is a special format that has an external DTD. The generic class in
Jersey does not have the capability to create xml to that schema and should
not be announcing that it can. The faulty application/xaml+xml causes IE to
crash hard.

I haven’t yet tested what various RSS readers do when confronted with
malformed feeds – but I doubt that it’s pretty.

We have modified the current Jersey jars to prevent the XML*.General Entity
Providers from being loaded. This is not maintainable. If the General Entity
Providers are considered essential to the Jersey implementation of JSR311
then we would like the ability to configure the Entity Providers at runtime.

While the specification states that “An implementation MUST include
pre-packaged MessageBodyReader and MessageBodyWriter implementations for the
following Java and media type combinations”, it does not say that an
instance of an implementation must load these MessageBodyReader and
MessageBodyWriter objects at runtime.

Regards,