我对 Rest Easy 很陌生。
我最近将 RestEasy 添加到了我的 Grails 项目中。它已经有一些爬虫库在工作。我收到以下异常,我不确定哪些 jars 等存在冲突或根本原因是什么。我正在使用 JDK 1.7
因为我在下面的代码行中得到了这个(在获取实例时)我认为这是一个 jar 冲突问题
ResteasyProviderFactory.getInstance()
| Error Caused by: java.lang.RuntimeException: Unable to instantiate MessageBodyWriter
| Error at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:849)
| Error at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:70)
| Error at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
| Error ... 13 more
| Error Caused by: java.lang.ClassCastException: com.sun.proxy.$Proxy28 cannot be cast to javax.ws.rs.Produces
| Error at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyWriter(ResteasyProviderFactory.java:566)
| Error at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyWriter(ResteasyProviderFactory.java:536)
| Error at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:845)
| Error ... 15 more
除了 grails 配置的插件和 jars,我的路径中有以下 jars
activation.jar
apache-mime4j-benchmark-0.7.2.jar
apache-mime4j-core-0.7.2.jar
apache-mime4j-dom-0.7.2.jar
apache-mime4j-examples-0.7.2.jar
apache-mime4j-storage-0.7.2.jar
asm-3.1.jar
attributes.jar
boilerpipe-1.1.0.jar
commons-beanutils-1.8.3.jar
commons-codec-1.6.jar
commons-compress-1.3.jar
commons-io-2.1.jar
commons-logging-1.1.1.jar
commons-net-3.2.jar
crawler4j-3.5.jar
ebaycalls.jar
ebaysdkcore.jar
FastInfoset.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
helper.jar
http.jar
httpclient-4.2.3.jar
httpcore-4.2.2.jar
httpmime-4.2.3.jar
jackson-core-asl-1.9.9.jar
jackson-jaxrs-1.9.9.jar
jackson-mapper-asl-1.9.9.jar
jackson-xc-1.9.9.jar
jakarta-oro-2.0.8.jar
jaxb-api.jar
jaxb-impl.jar
jaxb-xjc.jar
jaxrs-api-2.3.5.Final.jar
jaxws-api.jar
jaxws-rt.jar
jaxws-tools.jar
je-4.0.92.jar
jsoup-1.7.1.jar
jsr173_api.jar
jsr181-api.jar
jsr250-api.jar
list
log4j-1.2.16.jar
metadata-extractor-2.4.0-beta-1.jar
mimepull.jar
opencsv-2.3.jar
resolver.jar
resteasy-atom-provider-2.3.5.Final.jar
resteasy-cache-core-2.3.5.Final.jar
resteasy-cdi-2.3.5.Final.jar
resteasy-crypto-2.3.5.Final.jar
resteasy-fastinfoset-provider-2.3.5.Final.jar
resteasy-guice-2.3.5.Final.jar
resteasy-jackson-provider-2.3.5.Final.jar
resteasy-jaxb-provider-2.3.5.Final.jar
resteasy-jaxrs-2.3.5.Final.jar
resteasy-jettison-provider-2.3.5.Final.jar
resteasy-jsapi-2.3.5.Final.jar
resteasy-links-2.3.5.Final.jar
resteasy-multipart-provider-2.3.5.Final.jar
resteasy-oauth-2.3.5.Final.jar
resteasy-spring-2.3.5.Final.jar
resteasy-yaml-provider-2.3.5.Final.jar
saaj-api.jar
saaj-impl.jar
serializer.jar
sjsxp.jar
solr-core-4.2.0.jar
solr-solrj-4.2.0.jar
stax-ex.jar
streambuffer.jar
tagsoup-1.2.1.jar
tika-app-1.2.jar
tika-bundle-1.2.jar
xalan.jar