-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple applications using jjwt leading to ServiceConfigurationError io.jsonwebtoken.jackson.io.JacksonSerializer not a subtype #751
Comments
Thanks for reporting this! It appears to be a classloader issue, but I'm not sure how we can re-create the issue for testing without some help setting up a test instance with multiple webservices. That said, there is a solid workaround for this issue: That logic only executes if you don't specify your own Serializer instance. You can instantiate https://github.com/jwtk/jjwt#json-custom where While that workaround should get you moving forward with 0.11.x, I wonder if reverting to the previous Class loading strategy might be something we can look at again. That implementation used our |
Hi @lhazlewood
I sadly don't know either how to re-create this issue on an automated testing envirnoment. Let me know if I can help you if you decide to tackle this. Kind regards, Raphael |
@raphisuter Technically it's an issue with the JDK's That said, I don't know that we necessarily need to try and re-create the problem - I think a better approach is to remove the use of |
Thanks again for the report on this @raphisuter. I'm closing this issue now that we have #752 to represent work to address this issue as well as #648. |
Thank you @lhazlewood for your help and effort, really appreciate it. |
Describe the bug
Since we updated jjwt from version 0.10.7 to 0.11.X we encounter an error saying
io.jsonwebtoken.io.Serializer: Provider io.jsonwebtoken.jackson.io.JacksonSerializer not a subtype
We run multiple cxf rest clients on the same TomEE instance, all of them using our internal security module which is working with jjwt to create and validate jwts. Since we updated from version 0.10.7 to a version starting from 0.11.0 we encounter the problem that only the first application using jjwt functionality works like expected. All others following encounter following problem:
io.jsonwebtoken.io.Serializer: Provider io.jsonwebtoken.jackson.io.JacksonSerializer not a subtype
while creating a JWT. The order of the webservices creating a token doesn't matter. Trying to mix up which one calls for a jwt first still leads to errors on all other following. Creating a jwt for the first webservice still works after the others tried to get jwts and produce the exception.This is the code we use to create JWTs:
The Problem happens while doing the
compact()
. There the serializer is loaded which throws the error mentioned above.Checking the code I can see the there was a change done starting from 0.11.0 which changed the way the serializer is loaded. Seeing the code my guess is a classLoader problem.
DefaultJwtBuilder.compact(); in V 0.10.7
DefaultJwtBuilder.compact(); in V 0.11.0
To Reproduce
Steps to reproduce the behavior:
io.jsonwebtoken.io.Serializer: Provider io.jsonwebtoken.jackson.io.JacksonSerializer not a subtype
Expected behavior
DefaultJwtBuilder.compact() loads an instance of JacksonSerializer correctly
stacktrace.txt
The text was updated successfully, but these errors were encountered: