I'm trying to implement some basic functionality with the newest DocuSignApi for Java (version 2.6.2). I'm currently just trying to get the JWT Authorization Flow working. Here's the code:
ApiClient apiClient = new ApiClient();
this.apiClient.configureJWTAuthorizationFlow(this.adminProperties.getRsaPublicKey(), this.adminProperties
.getRsaPrivateKey(), this.adminProperties.getoAuthBaseUrl(), this.adminProperties.getIntegratorKey(),
this.adminProperties.getImpersonatedUserGuid(), TOKEN_EXPIRATION_IN_SECONDS);
On the `ApiClient.configureJWTAuthorizationFlow(...) call above I'm receiving the following runtime error:
Caused by: java.lang.ClassNotFoundException: com.auth0.jwt.exceptions.JWTCreationException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I do not receive any compilation errors, just to be clear.
I have added this to my project pom as indicated from the DocuSignApi Java Wiki:
<dependency>
<groupId>com.docusign</groupId>
<artifactId>docusign-esign-java</artifactId>
<version>2.6.2</version>
</dependency>
Now I'm also using a Maven archetype that is pulling in a ton of other jars that are used with all of my company's projects and are needed for other functionality in my application. I can see that my effective pom is pulling in this version of java-jwt & spring-security-jwt:
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.8.RELEASE</version>
</dependency>
I also noticed that one of the dependencies listed on the DocuSignApi Java Wiki is as such:
org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2
I suspect that my error may have something to do with a version conflict between the JWT 2.2.0 in my archetype and the required 1.0.2 version from DocuSign.
My questions are
Is my error indeed caused by a version conflict with the JWT jar?
If so, what's the best way to remedy this problem? Can the DocuSignApi work with a newer version of JWT like I have?
Thank you for your time!
The issue here ended up being conflicting versions of the java-jwt jar. My project is using the 2.2.0 version, but the dependency needed for the 2.6.2 version of the Java DocuSign API is 3.2.0.
The
org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2
dependency I listed above was a misnomer...that wasn't the conflicting jar.
Since I do not have the ability to upgrade to the java-jwt 3.2.0 jar at this time I am forced to downgrade my Java DocuSign API to 2.2.1 where the dependency on the java-jwt is non-existent.
Hopefully someone else can benefit from the rather simple mistake I made here.
Related
Recently we have upgraded axis2 library in our project. We have upgraded it to 1.7.9 from 1.6.2
and since then we are facing below issue.
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:99)
at org.glassfish.jersey.client.JerseyWebTarget.<init>(JerseyWebTarget.java:71)
at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:290)
at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:76)
at com.xyz.MyClass.method1(MyClass.java:55)
As you can see our MyClass.method1() method call JerseyClient.target() which is in jersey-client library (Version 2.23.1) which internally
calls methods of javax.ws.rs-api library ((Version 2.0.1).
RuntimeDelegate class of that library is trying to load RuntimeDelegateImpl at runtime
which is jersey-bundle. But I dont know how its related to Axis2 library. Could you please help me out finding the root cause of this issue ?
I have found similar issue in SO but actual root cause is not mentioned there.
Link : Error when updating Axis2 web services from version 1.5.6 to 1.6.3
Thanks
For maven project, addding below dependency fixed issue for me in the pom.xml file under dependencies.
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.12</version>
</dependency>
I upgraded from springboot 2.1.3 to 2.2.0. So far things works fine but I noticed when I make a rest request that returns a 400, instead of getting the json response I get the error:
[Tomcat].[localhost] : Exception Processing ErrorPage[errorCode=0, location=/error]
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;
The funny thing is I get this only when I start the app from Intellij using an emdedded tomcat. (create a mvn profile with "spring-boot:run")
So,
With standalone tomcat, it works fine everywhere
With embedded tomcat, and only if I start from Intellij I get this error.
But I can do the same thing from command line with
mvn spring-boot:run
which then I have no error ?! As suggested on another post I upgraded my IntelliJ to latest version but didn't help
i think you have to upgrade the version of ur tomcat emdedded , there is a version mismatch.
Spring Boot 2.1.X uses Tomcat 9 which has the Servlet API v4.
But Spring Boot Web 2.1.X still incorporates Servlet API v3.1.
OR
Change tomcat version proprety
<properties>
<tomcat.version>8.5.37</tomcat.version>
<properties>
NB:The tomcat.version property is a normal Maven property in your pom.xml. Just add the tomcat.version to your existing Maven properties
I fixed the problem.
Changing property tomcat.version didn't help, so I omitted it and added this to the child pom (trick is it does not work in parent pom). Also note that the version is 2.2.4 and not 2.2.0
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
Just wanted to mention another "solution", because I just faced the same problem, after upgrading to Spring Boot 2.4.0
My App is running on Java 11, Spring Boot 2.4.0 AND JakartaEE Api 8.0.0
For a long time I ignored the Jakarta Version, because I found nothing regarding my problem and this dependency in the web.
But after upgrading JakartaEE to 9.0.0 everything worked out fine.
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.0.0</version>
</dependency>
That was the solution for my problem :) maybe it helps others.
I was using Jython standalone version 2.5.3 in my REST application. It was working fine. When I upgraded to Jython 2.7.0, I am getting the following exception,
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.python.apache.xalan.processor.TransformerFactoryImpl not found
Java xml classes were packaged and distributed with version 2.7.0. But if I understand it correctly Java SE comes with these classes. This issue is raised as a bug here. In order to avoid this exception add the xalan processor dependency in your pom.xml
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
Another solution would be to upgrade to the latest version of the jython-standalone jar. This issue is fixed in the latest release 2.7.1
OK I am trying to use http://jongo.org, in a project I have run mvn install and dropped the jar it returns into my project but when I try and use Jongo I get Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/Module Does Jongo not package these directly?
My question is do I need to then manually include the other jars it depends on aswell into my project root?
Yes, you need add this dependency manually in maven:
Jongo relies upon Jackson 2.4.1, Bson4Jackson 2.4.0 and Mongo Java Driver 2.11+. Its Maven dependency, an OSGI compliant jar, comes with
the first two, you have to provide a dependency to the driver.
Jongo is deployed into OSS Sonatype (Maven repository hosting service
for open source projects). Add the following dependency to your
pom.xml
<dependency>
<groupId>org.jongo</groupId>
<artifactId>jongo</artifactId>
<version>1.2</version> </dependency>
</dependency>
Is anybody else working on wurfl API version 1.4 (latest stable release). I am stuck on configuring my pom.xml for wurfl 1.4
I do not want to add wurfl manually.
ScintiaMobile says that new wurfl is hosted at their server. But the link they provide does not contain 1.4
In short my problem is I have to use maven and wurfl 1.4
Luca Passani, ScientiaMobile's CTO here.
I know some user of the WURFL java API have requested support for Maven.
ScientiaMobile had removed Maven support in 2011, to avoid that people would inject AGPL code in their code base without fully realizing the implications of the AGPL license (strong-copyleft).
We have now introduced support for Maven for commercial licensees of the library, who can use their ScientiaMobile credentials to interact with our private Maven repo.
Details here:
http://www.scientiamobile.com/page/wurfl-adds-maven-support-for-java-programmers
thanks
Well, if the following doesn't work in your pom.xml file:
<dependency>
<groupId>net.sourceforge.wurfl</groupId>
<artifactId>wurfl</artifactId>
<version>1.4</version>
</dependency>
Then what you could probably do is download the proper JAR and stick it into your organization's maven repository (Nexus, Archiva, etc) by uploading it by hand.
Download the jar from https://sourceforge.net/projects/wurfl/files/ .
Add following in your pom.xml:
<dependency>
<groupId>net.sourceforge.wurfl</groupId>
<artifactId>wurfl</artifactId>
<version>{{the.version}}</version>
</dependency>
Fire the below command:
mvn install:install-file -Dfile=path_to_jar/thejar.jar -DgroupId=net.sourceforge.wurfl -DartifactId=wurfl -Dversion=the.version -Dpackaging=jar
This will add the jar in your .m2 folder which can later be picked while your are building your maven project.