简体   繁体   中英

java.lang.NoSuchMethodError: com.sun.jersey.core.spi.factory.MessageBodyFactory.<init>(Lcom/sun/jersey/core/spi/component/ProviderServices;)V

I am trying to deploy a maven build Java project to JBoss server web project. I am able to reach the desired server. However, I could not get the intended reply back from server. The error comes up as :

java.lang.NoSuchMethodError: com.sun.jersey.core.spi.factory.MessageBodyFactory.<init>(Lcom/sun/jersey/core/spi/component/ProviderServices;)V
    at com.sun.jersey.api.client.Client.<init>(Client.java:230)
    at com.sun.jersey.api.client.Client.<init>(Client.java:158)
    at com.sun.jersey.api.client.Client.create(Client.java:573)

I have jerser-core 1.2, jersey-bundle 1.2, jersey-server 1.2, jersey-client 1.2, jersey servlet 1.17, and jersey

at com.sun.jersey.api.client.Client.<init>(Client.java:230)
    at com.sun.jersey.api.client.Client.<init>(Client.java:158)
    at com.sun.jersey.api.client.Client.create(Client.java:573)

1.17 in my lib folder.

My guess is that there is something wrong with tha jars in your classpath. Probably, you may have two different versions of jersey on your classpath or in WEB-INF/lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM