fastjson jboss resteasy 2.2.1.GA ResteasyProviderFactory 加载报错

bcs8qyzn  于 3个月前  发布在  其他
关注(0)|答案(3)|浏览(62)

原来fastjson 版本1.2.7 直接升级到1.2.28时,业务原来用到org.jboss.resteasy.spi.ResteasyProviderFactory 加载时报错:
java.lang.RuntimeException: Illegal to inject a message body into a singleton into public com.alibaba.fastjson.support.jaxrs.FastJsonProvider(java.lang.String)
at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:209)
at org.jboss.resteasy.core.ConstructorInjectorImpl.injectableArguments(ConstructorInjectorImpl.java:63)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:129)
at org.jboss.resteasy.spi.ResteasyProviderFactory.getProviderInstance(ResteasyProviderFactory.java:1038)
at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:478)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:756)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:70)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
at org.jboss.resteasy.spi.ResteasyProviderFactory.getInstance(ResteasyProviderFactory.java:352)

jboss resteasy 版本为:
version=2.2.1.GA
groupId=org.jboss.resteasy
artifactId=resteasy-jaxrs

p1iqtdky

p1iqtdky1#

先升级到1.2.7.sec01版本吧
http://repo1.maven.org/maven2/com/alibaba/fastjson/1.2.7.sec01/
这个兼容版本也是安全的

8gsdolmq

8gsdolmq2#

1.2.28以上哪个版本支持resteasy?有解决吗?

iqih9akk

iqih9akk3#

同问1.2.28版本的支持

相关问题