I have an API that receives a JWT token for authorization.
Once it starts the process of working with the token to authenticate it throws this error:
Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
I read that in Java 11 they removed the java.xml.bind library from the JDK. I added these two dependencies as suggested in the answer:
implementation "jakarta.xml.bind:jakarta.xml.bind-api:3.0.0"
and
implementation "org.glassfish.jaxb:jaxb-runtime:3.0.0"
.
Also tried implementation "jakarta.xml.bind:jakarta.xml.bind-api:3.0.0"
and implementation 'com.sun.xml.bind:jaxb-impl:3.0.0'
.
But I still get the same error and I cannot find any other solution to this.
I use Java 11 and Spring boot 2.6.6.
Thanks for the help