Restful resteasy - Client (Ava.lang.Nosuchmethoderror)

Asked

Viewed 99 times

1

I’m trying to access a Webservice

Code:

public void testeWSRestful() {
    Client client = ClientBuilder.newBuilder().build();
    WebTarget target = client.target("http://localhost:8080/teste");
    Response response = target.request().get();
}

And here’s the thing

Error:

java.lang.NoSuchMethodError: org.jboss.resteasy.spi.ResteasyProviderFactory.(Lorg/jboss/resteasy/spi/ResteasyProviderFactory;) V: org.jboss.interceptor.proxy.InterceptorException: java.lang.NoSuchMethodError: org.jboss.resteasy.spi.ResteasyProviderFactory.(Lorg/jboss/resteasy/spi/ResteasyProviderFactory;) V

Maven:

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-client</artifactId>
    <version>3.0.9.Final</version>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxb-provider</artifactId>
    <version>3.0.9.Final</version>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jaxrs</artifactId>
    <version>3.0.9.Final</version>
</dependency>

Can anyone tell me what’s missing, or where the mistake is?

  • I did a local test using these same dependency and it worked in a java application. For the message is running an application on Jboss, right? What’s the version of container? If it’s even in the Jboss / Wildfly, try changing the scope of dependencies to provided.

  • I’m using the Jboss7 and JEE7 . Change to provided in my contoller? Thank you

  • Change to provided in the application you have this REST client(testeWSRestful) and do the deploy again.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.