question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spring Boot + spring-security-oauth2-resource-server should not throw a ClassNotFoundException once it supports more than one token format

See original GitHub issue

While it’s true that Resource Server effectively requires spring-security-oauth2-jose at this point, it shouldn’t once it supports more than one token format.

When spring-boot-starter-security and spring-security-oauth2-resource-server are used together, without further configuration, the application throws the following exception:

Caused by: java.lang.ClassNotFoundException: org.springframework.security.oauth2.jwt.JwtDecoder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 111 more

In all likelihood, this will be taken care of naturally when coordinating with the boot team to add support for a second token format.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jzheauxcommented, Dec 5, 2018

This is just to ensure we validate that. Agreed that it should naturally sort itself out.

0reactions
jzheauxcommented, Sep 4, 2019

Confirmed by creating a project using the describing configuration and observing that it ran without error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BearerTokenAccessDeniedHand...
The exception disappeared when I added spring-boot-starter-oauth2-resource-server dependency.
Read more >
spring-projects/spring-security - Gitter
Hello, I've got a question on how to handle pagination requests filtered by security layer. For example, I have some entities that are...
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
How to resolve java.lang.ClassNotFoundException in Java ...
When you are in a multi-classloader environment (In a EE environment, for example, but not limited to), each classloader may have its own...
Read more >
java.lang.ClassNotFoundException - DigitalOcean
Java compiler has no way to know if the class will be present in the classpath at runtime or not. One of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found