Salma Louhaichy
Salma Louhaichy

Reputation: 21

java.lang.NoSuchMethodError: 'void org.glassfish.jersey.model.internal.CommonConfig.<init>(javax.ws.rs.RuntimeType, java.util.function.Predicate)'

I am working on use the embedded e-signature in my web app ( java eclipse) i get this error and i do not understand what it means ?:

    java.lang.NoSuchMethodError: 'void org.glassfish.jersey.model.internal.CommonConfig.<init> 
    (javax.ws.rs.RuntimeType, java.util.function.Predicate)'
    org.glassfish.jersey.client.ClientConfig$State.<init>(ClientConfig.java:140)
    org.glassfish.jersey.client.ClientConfig.<init>(ClientConfig.java:496)
    com.docusign.esign.client.ApiClient.buildHttpClient(ApiClient.java:1753)
    com.docusign.esign.client.ApiClient.<init>(ApiClient.java:77)
    com.docusign.esign.client.Configuration.<clinit>(Configuration.java:5)
    com.docusign.esign.api.EnvelopesApi.<init>(EnvelopesApi.java:16)
    com.uniquedeveloper.registration.test2.EmbeddedSigningTest(test2.java:141)
    com.uniquedeveloper.registration.test2.doPost(test2.java:64)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Here is my updated pom file , i am still trying to work through the different versions of jersey but none of them have worked so far.

    <project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>Trial1</groupId>
      <artifactId>Trial1</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
              <release>15</release>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.3</version>
          </plugin>
        </plugins>
      </build>
       <properties>
            <java.version>11</java.version>
            <oauth2.version>2.5.6</oauth2.version>
            <commonsio.version>2.11.0</commonsio.version>
            <docusign.version>3.18.0</docusign.version>
            <rooms.version>1.1.0</rooms.version>
            <click.version>1.0.0</click.version>
            <monitor.version>1.1.0</monitor.version>
            <admin.version>1.0.0-BETA</admin.version>
        </properties>
    <dependencies>
     <dependency>

Upvotes: 1

Views: 4765

Answers (3)

hemisphire
hemisphire

Reputation: 1235

I had a similar problem that I was pulling my hair out over, where I could run

mvn dependency:tree

And everything was using a single version and looked fine. Turned out I had multiple versions of the same jar in my local Maven repository. I deleted everything and rebuilt, no more errors.

Upvotes: 0

Scott Robey
Scott Robey

Reputation: 1751

I ran into the same exception, although in a slightly different context, when trying to set up a jersey-server, and looks like you are encountering this in the setup of jersey-client, but I suspect the issue is the same.

In my case, I was using jersey-server 2.28 (org.glassfish.jersey.core:jersey-server:2.28), and tracked down that the class: org.glassfish.jersey.model.internal.CommonConfig comes from the jersey-common.jar (org.glassfish.jersey.core:jersey-common).

Looking at the jars in my classpath I noticed that a jersey-common-3.1.0.jar had made it's way into the classpath and believe that was causing the issue. After removing the offending dependency that was causing jersey-common 3.1.0 to be pulled into the classpath, the exception went away.

I suspect you are using jersey-client version: 2.x but have a jersey-common 3.x jar in the classpath

Upvotes: 0

Docusign Dev
Docusign Dev

Reputation: 41

I'm guessing that this is due to multiple versions of jersey-client in your codebase. Docusign's current jersey-client version is 2.29.1. Are you able to update your other versions to at least that, or you can add dependencies in your pom.xml for specific versions like so here: https://www.tutorialspoint.com/maven/maven_external_dependencies.htm. Please try that and let us know.

Upvotes: 2

Related Questions