docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
105 stars 96 forks source link

ApiClient line 1532 throws "java.lang.NoClassDefFoundError: Could not initialize class org.glassfish.jersey.internal.inject.Providers" #181

Closed AugustZellmer closed 3 years ago

AugustZellmer commented 3 years ago

I've just imported the Docusign 3.10.1 jar into my project, and I attempted to instantiate an ApiClient. But the ApiClient's constructor throws java.lang.NoClassDefFoundError: Could not initialize class org.glassfish.jersey.internal.inject.Providers on line 1532. I thought that I might simply have a conflicting version of Jersey on my classpath, but after checking I confirmed that the only version of Jersey I'm importing is version 2.29.1 - the version imported by the Docusign jar itself. Any idea what could be causing this? or how I could debug this?

stack trace:

"org.glassfish.jersey.model.internal.ComponentBag.modelFor(ComponentBag.java:495)"
"org.glassfish.jersey.model.internal.ComponentBag.lambda$registerModel$10(ComponentBag.java:454)"
"org.glassfish.jersey.internal.Errors.process(Errors.java:292)"
"org.glassfish.jersey.internal.Errors.process(Errors.java:274)"
"org.glassfish.jersey.internal.Errors.process(Errors.java:205)"
"org.glassfish.jersey.model.internal.ComponentBag.registerModel(ComponentBag.java:446)"
"org.glassfish.jersey.model.internal.ComponentBag.register(ComponentBag.java:283)"
"org.glassfish.jersey.model.internal.CommonConfig.register(CommonConfig.java:434)"
"org.glassfish.jersey.client.ClientConfig$State.register(ClientConfig.java:215)"
"org.glassfish.jersey.client.ClientConfig.register(ClientConfig.java:594)"
"com.docusign.esign.client.ApiClient.buildHttpClient(ApiClient.java:1532)"
"com.docusign.esign.client.ApiClient.<init>(ApiClient.java:82)"
"com.docusign.esign.client.ApiClient.<init>(ApiClient.java:102)"

Also see https://github.com/eclipse-ee4j/jersey/issues/4730

AugustZellmer commented 3 years ago

I did exclude jakarta.ws.rs-api, because I'm using Resteasy 3 instead. Could that be what broke it?

AugustZellmer commented 3 years ago

I figured it out. I had excluded the Jakarta dependency, thinking that Resteasy3's implementation of RS would work. It didn't work; using Jakarta's implementation did.