Using RESTEasy client already defined for REST extension

solved

#1

Hey!

I’m running into a problem when trying to upgrade the RESTEasy client that the REST extension (1.0.0.Final-SNAPSHOT) uses. There was an issue in 3.0.14 and lower (RESTEASY-1250), but it was resolved in 3.0.17.Final. My application also needs the client to make calls to third-party APIs, so it’ll be in the compile scope.

However, when adding the RESTEasy Client dep definition, I get this deployment error:

Caused by: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./dc3441f4-3d16-40a6-ab5b-9fb1aecbdf52" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./dc3441f4-3d16-40a6-ab5b-9fb1aecbdf52: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
    Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
    Caused by: java.lang.ExceptionInInitializerError
    Caused by: org.jboss.weld.exceptions.WeldException: WELD-000625: Unable to locate method: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
    Caused by: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)"}}

Full Stacktrace

This is how the deps are defined:

    <!-- Client -->
    <dependency>
       <groupId>org.jboss.resteasy</groupId>
       <artifactId>resteasy-client</artifactId>
       <version>3.0.18.Final</version>
    </dependency>
    <!-- clip -->
    <!-- REST Client extension -->
    <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-rest-client-api</artifactId>
        <version>1.0.0.Final-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-rest-client-impl-3x</artifactId>
        <version>1.0.0.Final-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>

Any ideas?


#2

UPDATE: I did not know this but Wildfly comes with RESTEasy Client 3.0.14, just like the Rest extension. I updated the modules in the server.

Moral of the story: Make sure you’re aware that you aren’t repackaging modules. That’s what threw those errors. The RESTEasy website has the modules you need to unpack. The extension will pick up whatever RESTEasy instance it’s given, just make sure to mark the client has provided.