2014-02-17 141 views
0

從另一個Jersey REST服務調用一個Jersey REST服務時出現以下錯誤。兩者都部署在不同的tomcats.Called服務上運行在澤西島版本1.16和呼叫服務運行在1.4 當我使用Grizzly服務器在本地機器上部署我的呼叫服務時,情況正常,但是當我將它部署在tomcat上時,我面臨着這個問題。Jersey REST服務調用另一個Jersey REST服務時發生錯誤 - java.lang.IllegalArgumentException:參數類型不匹配

SEVERE: The provider class, class com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General, could not be instantiated. Processing will continue but the class will not be utilized 
java.lang.IllegalArgumentException: argument type mismatch 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
     at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:198) 
     at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:169) 
     at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166) 
     at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137) 
     at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:256) 
     at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160) 
     at com.sun.jersey.core.spi.factory.MessageBodyFactory.initWriters(MessageBodyFactory.java:207) 
     at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:163) 
     at com.sun.jersey.api.client.Client.init(Client.java:326) 
     at com.sun.jersey.api.client.Client.access$000(Client.java:118) 
     at com.sun.jersey.api.client.Client$1.f(Client.java:189) 
     at com.sun.jersey.api.client.Client$1.f(Client.java:185) 
     at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197) 
     at com.sun.jersey.api.client.Client.<init>(Client.java:185) 
     at com.sun.jersey.api.client.Client.<init>(Client.java:168) 
     at com.sun.jersey.api.client.Client.create(Client.java:638) 

...

Loaded com.sun.jersey.client.urlconnection.HttpURLConnectionFactory from file:/fmrkut3/apps/UAT3/venture/lib/jersey-client-1.4.jar] 
[Loaded com.sun.jersey.api.client.ClientRequest from file:/fmrkut3/apps/UAT3/venture/lib/jersey-client-1.4.jar] 
Feb 17, 2014 4:15:08 AM com.sun.jersey.spi.inject.Errors processErrorMessages 
SEVERE: The following errors and warnings have been detected with resource and/or provider classes: 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.xml.SAXParserContextProvider(com.sun.jersey.core.util.FeaturesAndProperties) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.xml.XMLStreamReaderContextProvider(com.sun.jersey.core.util.FeaturesAndProperties) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.xml.DocumentBuilderFactoryProvider(com.sun.jersey.core.util.FeaturesAndProperties) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.xml.TransformerFactoryProvider(com.sun.jersey.core.util.FeaturesAndProperties) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General(com.sun.jersey.spi.inject.Injectable,javax.ws.rs.ext.Providers) at parameter index 0 
    SEVERE: Missing dependency for constructor public com.sun.jersey.core.impl.provider.entity.DocumentProvider(com.sun.jersey.spi.inject.Injectable,com.sun.jersey.spi.inject.Injectable) at parameter index 0 

回答

1

隨着底部堆棧跟蹤意味着,你有一個丟失的庫;如果我沒有記錯的話,這是

<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-core</artifactId> 
    <version>1.16</version> 
</dependency> 

這個庫可能存在於你的本地CONFIGRATION(或與灰熊捆綁),而不是使用Tomcat。

相關問題