John Hump

Greenhorn
+ Follow
since Oct 25, 2017
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Hump

Found the answer to the issue myself. Turns out there was a jjwt 0.8 jar present in the jvm/ext folder (which I must have placed some time ago, accidentally or intentionally - doesn't matter) so instead of resolving the jjwt jar from the WEB-INF/lib it was getting resolved at jvm/ext. I had previously noticed this but assumed the issue has nothing to do with this as I expected the other jar would be found elsewhere.

Turns out since the jjwt was present in jvm/ext folder the class loader was looking for its dependency in the same folder without looking for it anywhere else, like the WEB-INF/lib.

This is likely because class loaders work in hierarchies different loaders look at different levels. The Bootstrap loader in this instance looks for class files in jvm/ext. The WEB/INF/lib responsible loader is the WebappX loader. So in short, I deleted the jar in jvm/ext and all is well in the world again.

1 year ago
Sorry for the confusion but I can't seem to find the edit function on the original post. The class that I created an object for was in jackson.databind. So, Tomcat may actually not be able to find the JAR. Again, really sorry for that mistake.
1 year ago
My WEB-INF/lib contains "jackson-core-2.8.10.jar" which contains the necessary class file. In fact I am able to create objects for other classes in the same jar, so it isn't as f the jar itself is invisible somehow. But when running on Tomcat I am getting a ClassNotFoundException. I am posting the stacktrace below. This error has been giving me nightmares for the past week. Absolutely any sort of hint will be appreciated. Please feel free to call me an idiot.

Relevant information:
Tomcat version: Apache Tomcat/8.5.23
Java version: 1.8.0_151
I am getting the exception in the following line:



Same code, same test cases running on a windows machine with same Java and Tomcat machine. Unfortunately, don't have access to the pc whole time otherwise I would have developed on it. Even stranger, when I try to place a try catch around the statement to catch the particular error I get:

Error:(61, 11) java: exception com.fasterxml.jackson.core.JsonProcessingException is never thrown in body of corresponding try statement

Here's the stack trace when I receive the request.

2017-10-26 05:23:22.110 ERROR 7422 --- [nio-8080-exec-2] o.s.boot.web.support.ErrorPageFilter     : Forwarding to error page from request [/token] due to exception [com/fasterxml/jackson/core/JsonProcessingException]

1 year ago