Skip to content

java.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module #601

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

Closed
rcbandit111 opened this issue Jan 22, 2022 · 4 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@rcbandit111
Copy link

I'm trying to implement Spring Authorization Server with PostgreSQL:

    @Bean
    public RegisteredClientRepository registeredClientRepository(JdbcTemplate jdbcTemplate) {
        RegisteredClient registeredClient = RegisteredClient.withId(UUID.randomUUID().toString())
          .clientId("articles-client")
          .clientSecret("{noop}secret")
          .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
          .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
          .authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN)
          .redirectUri("http://127.0.0.1:8080/login/oauth2/code/articles-client-oidc")
          .redirectUri("http://127.0.0.1:8080/authorized")
          .scope(OidcScopes.OPENID)
          .scope("articles.read")
          .scope("message.write")
          .build();

        // Save registered client in db as if in-memory
        JdbcRegisteredClientRepository registeredClientRepository = new JdbcRegisteredClientRepository(jdbcTemplate);
        registeredClientRepository.save(registeredClient);

        return registeredClientRepository;
    })

Full code example: https://github.com/rcbandit111/Spring_Cloud_Gateway_POC/blob/main/authorization_server/auth_poc/src/main/java/org/auth/config/AuthorizationServerConfig.java

SQL Script: https://github.com/rcbandit111/Spring_Cloud_Gateway_POC/blob/main/authorization_server/auth_poc/src/main/resources/changelog/changes/ch_0001/data/data.sql

But when I start the application I get error:

19:00:47.306 [main] DEBUG DefaultListableBeanFactory[createArgumentArray:808] - Autowiring by type from bean name 'jdbcTemplate' via factory method to bean named 'dataSource'
19:00:47.306 [main] DEBUG DefaultListableBeanFactory[createArgumentArray:808] - Autowiring by type from bean name 'jdbcTemplate' via factory method to bean named 'spring.jdbc-org.springframework.boot.autoconfigure.jdbc.JdbcProperties'
19:00:47.317 [main] DEBUG DefaultListableBeanFactory[createArgumentArray:808] - Autowiring by type from bean name 'registeredClientRepository' via factory method to bean named 'jdbcTemplate'
19:00:47.323 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.jackson2.CoreJackson2Module, now registering
19:00:47.325 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:109] - Cannot load module org.springframework.security.cas.jackson2.CasJackson2Module
java.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:284)
	at org.springframework.security.jackson2.SecurityJackson2Modules.loadAndGetInstance(SecurityJackson2Modules.java:102)
	at org.springframework.security.jackson2.SecurityJackson2Modules.addToModulesList(SecurityJackson2Modules.java:141)
	at org.springframework.security.jackson2.SecurityJackson2Modules.getModules(SecurityJackson2Modules.java:121)
	at org.springframework.security.oauth2.server.authorization.client.JdbcRegisteredClientRepository$RegisteredClientRowMapper.<init>(JdbcRegisteredClientRepository.java:209)
	at org.springframework.security.oauth2.server.authorization.client.JdbcRegisteredClientRepository.<init>(JdbcRegisteredClientRepository.java:114)
	at org.auth.config.AuthorizationServerConfig.registeredClientRepository(AuthorizationServerConfig.java:59)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1282)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1243)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ConfigurerUtils.getBean(OAuth2ConfigurerUtils.java:135)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ConfigurerUtils.getRegisteredClientRepository(OAuth2ConfigurerUtils.java:55)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientAuthenticationConfigurer.createDefaultAuthenticationProviders(OAuth2ClientAuthenticationConfigurer.java:161)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientAuthenticationConfigurer.init(OAuth2ClientAuthenticationConfigurer.java:129)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.lambda$init$1(OAuth2AuthorizationServerConfigurer.java:192)
	at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.init(OAuth2AuthorizationServerConfigurer.java:192)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.init(OAuth2AuthorizationServerConfigurer.java:68)
	at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:338)
	at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:300)
	at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
	at org.auth.config.AuthorizationServerConfig.authServerSecurityFilterChain(AuthorizationServerConfig.java:40)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
	at org.auth.MerchantHubAuthApplication.main(MerchantHubAuthApplication.java:13)
19:00:47.326 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.jackson2.WebJackson2Module, now registering
19:00:47.326 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.server.jackson2.WebServerJackson2Module, now registering
19:00:47.326 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.jackson2.WebServletJackson2Module, now registering
19:00:47.327 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module com.fasterxml.jackson.datatype.jsr310.JavaTimeModule, now registering
19:00:47.343 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.jackson2.CoreJackson2Module, now registering
19:00:47.344 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:109] - Cannot load module org.springframework.security.cas.jackson2.CasJackson2Module
java.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:284)
	at org.springframework.security.jackson2.SecurityJackson2Modules.loadAndGetInstance(SecurityJackson2Modules.java:102)
	at org.springframework.security.jackson2.SecurityJackson2Modules.addToModulesList(SecurityJackson2Modules.java:141)
	at org.springframework.security.jackson2.SecurityJackson2Modules.getModules(SecurityJackson2Modules.java:121)
	at org.springframework.security.oauth2.server.authorization.client.JdbcRegisteredClientRepository$RegisteredClientParametersMapper.<init>(JdbcRegisteredClientRepository.java:299)
	at org.springframework.security.oauth2.server.authorization.client.JdbcRegisteredClientRepository.<init>(JdbcRegisteredClientRepository.java:115)
	at org.auth.config.AuthorizationServerConfig.registeredClientRepository(AuthorizationServerConfig.java:59)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1282)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1243)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ConfigurerUtils.getBean(OAuth2ConfigurerUtils.java:135)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ConfigurerUtils.getRegisteredClientRepository(OAuth2ConfigurerUtils.java:55)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientAuthenticationConfigurer.createDefaultAuthenticationProviders(OAuth2ClientAuthenticationConfigurer.java:161)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientAuthenticationConfigurer.init(OAuth2ClientAuthenticationConfigurer.java:129)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.lambda$init$1(OAuth2AuthorizationServerConfigurer.java:192)
	at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.init(OAuth2AuthorizationServerConfigurer.java:192)
	at org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer.init(OAuth2AuthorizationServerConfigurer.java:68)
	at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:338)
	at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:300)
	at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
	at org.auth.config.AuthorizationServerConfig.authServerSecurityFilterChain(AuthorizationServerConfig.java:40)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
	at org.auth.MerchantHubAuthApplication.main(MerchantHubAuthApplication.java:13)
19:00:47.344 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.jackson2.WebJackson2Module, now registering
19:00:47.345 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.server.jackson2.WebServerJackson2Module, now registering
19:00:47.345 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module org.springframework.security.web.jackson2.WebServletJackson2Module, now registering
19:00:47.346 [main] DEBUG SecurityJackson2Modules[loadAndGetInstance:104] - Loaded module com.fasterxml.jackson.datatype.jsr310.JavaTimeModule, now registering
19:00:47.349 [main] DEBUG JdbcTemplate[query:711] - Executing prepared SQL query
19:00:47.349 [main] DEBUG JdbcTemplate[execute:643] - Executing prepared SQL statement [SELECT id, client_id, client_id_issued_at, client_secret, client_secret_expires_at, client_name, client_authentication_methods, authorization_grant_types, redirect_uris, scopes, client_settings,token_settings FROM oauth2_registered_client WHERE id = ?]
19:00:47.350 [main] DEBUG DataSourceUtils[doGetConnection:116] - Fetching JDBC Connection from DataSource
19:00:47.592 [main] DEBUG JdbcTemplate[update:958] - Executing prepared SQL update
19:00:47.593 [main] DEBUG JdbcTemplate[execute:643] - Executing prepared SQL statement [INSERT INTO oauth2_registered_client(id, client_id, client_id_issued_at, client_secret, client_secret_expires_at, client_name, client_authentication_methods, authorization_grant_types, redirect_uris, scopes, client_settings,token_settings) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
19:00:47.593 [main] DEBUG DataSourceUtils[doGetConnection:116] - Fetching JDBC Connection from DataSource

Do you know how I can fix this issue?

@rcbandit111 rcbandit111 added the type: bug A general bug label Jan 22, 2022
@rcbandit111 rcbandit111 changed the title java.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) java.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module Jan 22, 2022
@jgrandja
Copy link
Collaborator

@rcbandit111 CAS (spring-security-cas) support has been removed in Spring Security 6.0.0-SNAPSHOT, which is the version you are using given the ClassNotFoundException. Spring Authorization Server is not compatible with Spring Security 6.

Closing this as duplicate gh-598

@jgrandja jgrandja self-assigned this Jan 24, 2022
@jgrandja jgrandja added status: duplicate A duplicate of another issue and removed type: bug A general bug labels Jan 24, 2022
@carlwang87
Copy link

SpringBootVersion = '3.1.1'


    implementation "org.springframework.boot:spring-boot-starter-web"
    implementation "org.springframework.boot:spring-boot-starter-actuator"
    implementation "org.springframework.boot:spring-boot-starter-data-jpa"
    implementation "org.springframework.boot:spring-boot-starter-cache"
    implementation "org.springframework.boot:spring-boot-starter-validation"
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation "org.springframework.boot:spring-boot-starter-log4j2"
    implementation 'org.springframework.boot:spring-boot-starter-oauth2-authorization-server'

@jgrandja With the above configuration, it still encounters this issue.

@carlwang87
Copy link

Turns out, the stack trace is simply a trace debug log statement. It doesn't actually fail here.

@lixx174
Copy link

lixx174 commented Oct 25, 2023

Turns out, the stack trace is simply a trace debug log statement. It doesn't actually fail here.

but it's so unpleasant that when i reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants