Ticket: User Management - Validation Number

Hi everyone, the test cases to my JUnit tests are completing successfully. But, when I go to localhost:5000/status I just see the “User Management: invalid response to register”. Is there something else I must verify with my testing?

I also see error in my logs about JWTAuthEntryPoint : Unauthorized error: Full authentication is required to access this resource. It seems to not relate to my JUnit test issue but I still want to know why it is appearing and how to resolve it.

Thanks!

So I fixed the initial issue I had with compiling my code with JDK 8 instead of 11. Now I get an error complaining about duplicate user_id fields. I guess I should drop the collection? Then retry…

Yes, just drop collection.

I have the same problem. I check the log from the start it says " threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter] with root cause
java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter"

Any help?

Hi everyone!

I have the same issue…
All tests have already past successfully, but status page still red.

  • Tried to use JDK 8/11 didn’t help
  • Tried to load fresh data from /data archive, didn’t help too.

Any ideas?

Error log:
java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
at io.jsonwebtoken.impl.Base64Codec.decode(Base64Codec.java:26) ~[jjwt-0.9.1.jar:0.9.1]
at io.jsonwebtoken.impl.DefaultJwtBuilder.signWith(DefaultJwtBuilder.java:99) ~[jjwt-0.9.1.jar:0.9.1]
at mflix.api.services.TokenAuthenticationService.generateToken(TokenAuthenticationService.java:93) ~[classes/:na]
at mflix.api.services.UserService.generateUserToken(UserService.java:91) ~[classes/:na]
at mflix.api.services.UserService.authenticate(UserService.java:104) ~[classes/:na]
at mflix.api.controllers.UserController.authenticateUser(UserController.java:46) ~[classes/:na]
at mflix.api.controllers.UserController.register(UserController.java:64) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]

Okay, I was so lazy to google it.

For guys, who still live with this issue, you should add to your dependency next(pom.xml):

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>

P.S.: possible one more workaround, if you interested in, please check this link:

1 Like

Resolved Unauthorized error by adding the following dependency to pom.xml:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>

works for me:

 <dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0</version>
</dependency>
<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1.1</version>
</dependency>
1 Like