It looks like the variable jwtString is expected to be a String, but it isn't. The error is happening in jsonwebtoken code, but it may be caused by the way you're calling the library. Take a look at the rest of the stack trace in that error message, and find the first line that is referring to your own code. You're probably calling library code at that point. Try logging what you're passing to the call, and see if something looks wrong.