You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mike Youngstrom (JIRA)" <ji...@apache.org> on 2011/07/20 01:57:57 UTC
[jira] [Created] (CXF-3670) Regression CXF-3159: Jettison required
for json processing with some classloader implementations
Regression CXF-3159: Jettison required for json processing with some classloader implementations
------------------------------------------------------------------------------------------------
Key: CXF-3670
URL: https://issues.apache.org/jira/browse/CXF-3670
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: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3670) Regression CXF-3159: Jettison
required for json processing with some classloader implementations
Posted by "Mike Youngstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068664#comment-13068664 ]
Mike Youngstrom commented on CXF-3670:
--------------------------------------
I would be forever in your debt if it were possible for this fix to make it into 2.4.2. Thanks.
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> 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: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (CXF-3670) Regression CXF-3159:
Jettison required for json processing with some classloader implementations
Posted by "Mike Youngstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068656#comment-13068656 ]
Mike Youngstrom edited comment on CXF-3670 at 7/20/11 9:46 PM:
---------------------------------------------------------------
Here is a simple patch applied to trunk. I've tested it and it solves my problem.
{code}
Index: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
===================================================================
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (revision 1148828)
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (working copy)
@@ -66,7 +65,12 @@
@Consumes("application/json")
@Provider
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";
{code}
The exception escapes here:
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextFields(AbstractResourceInfo.java:82)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:118)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(ProviderFactory.java:103)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:63)
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:317)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:161)
was (Author: youngm):
Here is a simple patch applied to trunk. I've tested it and it solves my problem.
[code]
Index: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
===================================================================
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (revision 1148828)
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (working copy)
@@ -66,7 +65,12 @@
@Consumes("application/json")
@Provider
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";
[/code]
The exception escapes here:
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextFields(AbstractResourceInfo.java:82)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:118)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(ProviderFactory.java:103)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:63)
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:317)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:161)
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3670) Regression CXF-3159: Jettison
required for json processing with some classloader implementations
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068704#comment-13068704 ]
Sergey Beryozkin commented on CXF-3670:
---------------------------------------
Your fix has been applied - thanks - and of course you won't owe me anything :-) given
you've confirmed the fix is working :-), cheers
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.4.1
> Reporter: Mike Youngstrom
> Fix For: 2.4.2, 2.5
>
>
> 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3670) Regression CXF-3159: Jettison
required for json processing with some classloader implementations
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068274#comment-13068274 ]
Sergey Beryozkin commented on CXF-3670:
---------------------------------------
Just out of curiosity, where does the exception escape from this time ?
But adding a static check to JSONProvider provider seems like a good idea - please provide a patch
thanks
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> 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: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (CXF-3670) Regression CXF-3159:
Jettison required for json processing with some classloader implementations
Posted by "Mike Youngstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068656#comment-13068656 ]
Mike Youngstrom edited comment on CXF-3670 at 7/20/11 9:36 PM:
---------------------------------------------------------------
Here is a simple patch applied to trunk. I've tested it and it solves my problem.
[code]
Index: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
===================================================================
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (revision 1148828)
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (working copy)
@@ -66,7 +65,12 @@
@Consumes("application/json")
@Provider
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";
[/code]
The exception escapes here:
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.findContextFields(AbstractResourceInfo.java:82)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:118)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(ProviderFactory.java:103)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:63)
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:317)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:161)
was (Author: youngm):
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/JSONProvider.java
===================================================================
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (revision 1148828)
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (working copy)
@@ -66,7 +65,12 @@
@Consumes("application/json")
@Provider
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(AbstractResourceInfo.java:82)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:118)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(ProviderFactory.java:103)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:63)
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:317)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:161)
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> 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: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3670) Regression CXF-3159: Jettison
required for json processing with some classloader implementations
Posted by "Mike Youngstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068656#comment-13068656 ]
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/JSONProvider.java
===================================================================
--- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (revision 1148828)
+++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java (working copy)
@@ -66,7 +65,12 @@
@Consumes("application/json")
@Provider
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(AbstractResourceInfo.java:82)
at org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
at org.apache.cxf.jaxrs.provider.ProviderFactory.initJaxbProviders(ProviderFactory.java:118)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<init>(ProviderFactory.java:103)
at org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:63)
at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:317)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:161)
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> 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: http://www.atlassian.com/software/jira
[jira] [Resolved] (CXF-3670) Regression CXF-3159: Jettison required
for json processing with some classloader implementations
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-3670.
-----------------------------------
Resolution: Fixed
Fix Version/s: 2.5
2.4.2
Assignee: Sergey Beryozkin
> Regression CXF-3159: Jettison required for json processing with some classloader implementations
> ------------------------------------------------------------------------------------------------
>
> Key: CXF-3670
> URL: https://issues.apache.org/jira/browse/CXF-3670
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.4.1
> Reporter: Mike Youngstrom
> Assignee: Sergey Beryozkin
> Fix For: 2.4.2, 2.5
>
>
> 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: http://www.atlassian.com/software/jira