Reputation: 2485
I'm trying to post some Objects (Strings) to a REST service deployed on WildFly application server using a Java Desktop application.
Unfortunately, I don't have Maven available at runtime for the Client so I have to add manually the required JAR files. However even with a simple POST like this:
public static void testParam() {
Client client = ClientBuilder.newClient();
String s="DatiAtto.xml";
WebTarget myResource = client.target(BASE_URL+"/create");
Response rs = myResource.request()
.post(Entity.text(s), Response.class);
}
I get as return:
Unable to load builtin provider: org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider
So far I have added the following JAR files to the Desktop application:
looking at the content of them, the class org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider should be packaged into resteasy-jackson2-provider-3.0.8.Final.jar. Why is not being loaded ?
Upvotes: 5
Views: 14464
Reputation: 12865
Maven is a build tool. Whether or not Maven is available at run-time should be of no concern to your client.
You can use Maven to build an assembly or a shaded JAR (fat jar, über-JAR) which includes your client and all transitive dependencies of RESTeasy.
Upvotes: 0
Reputation: 209004
The problem is not that the ResteasyJackson2Provider
is missing, it's that the class is not able to load (as it tries to register itself automatically), due to dependencies on other jars (that's why we use Maven ;-). Have a look at this post.
There you will find all the dependent jars and where you can download them all, if you don't already have then stashed away somewhere.
Upvotes: 2