cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Youngstrom (JIRA)" <>
Subject [jira] [Commented] (CXF-3670) Regression CXF-3159: Jettison required for json processing with some classloader implementations
Date Wed, 20 Jul 2011 21:35:59 GMT


Mike Youngstrom commented on CXF-3670:

Here is a simple patch applied to trunk.  I've tested it and it solves my problem.

Index: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/	(revision
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/	(working
@@ -66,7 +65,12 @@
 public class JSONProvider extends AbstractJAXBProvider  {
+    static {
+        //Force the use of Jettison to ensure jettison is in the classpath: CXF-3670, CXF-3159
+        new SimpleConverter();
+    }
     private static final String MAPPED_CONVENTION = "mapped";
     private static final String BADGER_FISH_CONVENTION = "badgerfish";

The exception escapes here:

	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextFields(
	at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(
	at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(
	at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(
	at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(
	at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(
	at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(
	at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(

> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>                 Key: CXF-3670
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.4.1
>            Reporter: Mike Youngstrom
> We recently upgraded our application from 2.3.x to 2.4.1 and we appear to be having trouble
similar to that described in CXF-3159.
> In CXF-3159 the fix was to basically force the vm to do more class initialization.  I
wonder if a better fix would be to just modify the JSONProvider to more eagarly check for
a jettison class in a static initializer so that there is less reliance on Classloader implementations
to find the existence of dependencies like this?  I'd be happy to provide a patch if that
would be useful.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message