OIDC-NG restart - Cannot load module security.cas.jackson2

58 views
Skip to first unread message

Domingos Gonçalves

unread,
Apr 15, 2020, 12:13:53 PM4/15/20
to OpenConext Community
Hi,

we are having an error when we restart OIDCNG server.

The OIDC-NG works but on the last days we start notice the following message on the log saying it "cannot load module org.springframework.security.cas.jackson2.CasJackson2Module"

Any idea?

Our package software version:
  • OIDC-NG version 1.0.11
  • Java-1.8.0-openjdk-1.8.0.242
  • MongoDB 4.0.18-1

2020-04-15 17:03:17,825 DEBUG [main] o.s.s.jackson2.SecurityJackson2Modules:100 - Loaded module org.springframework.security.jackson2.CoreJackson2Module, now registering
2020-04-15 17:03:17,832 DEBUG [main] o.s.s.jackson2.SecurityJackson2Modules:106 - Cannot load module org.springframework.security.cas.jackson2.CasJackson2Module
java
.lang.ClassNotFoundException: org.springframework.security.cas.jackson2.CasJackson2Module
        at java
.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java
.lang.ClassLoader.loadClass(ClassLoader.java:419)
        at org
.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:92)
        at java
.lang.ClassLoader.loadClass(ClassLoader.java:352)
        at java
.lang.Class.forName0(Native Method)
        at java
.lang.Class.forName(Class.java:348)
        at org
.springframework.util.ClassUtils.forName(ClassUtils.java:282)
        at org
.springframework.security.jackson2.SecurityJackson2Modules.loadAndGetInstance(SecurityJackson2Modules.java:97)
        at org
.springframework.security.jackson2.SecurityJackson2Modules.addToModulesList(SecurityJackson2Modules.java:133)
        at org
.springframework.security.jackson2.SecurityJackson2Modules.getModules(SecurityJackson2Modules.java:119)
        at org
.springframework.session.data.mongo.JacksonMongoSessionConverter.buildObjectMapper(JacksonMongoSessionConverter.java:104)
        at org
.springframework.session.data.mongo.JacksonMongoSessionConverter.<init>(JacksonMongoSessionConverter.java:71)
        at oidc
.config.SessionConfig.mongoSessionConverter(SessionConfig.java:48)
        at oidc
.config.SessionConfig$$EnhancerBySpringCGLIB$$a114df44.CGLIB$mongoSessionConverter$0(<generated>)
        at oidc
.config.SessionConfig$$EnhancerBySpringCGLIB$$a114df44$$FastClassBySpringCGLIB$$f86dd8cd.invoke(<generated>)
        at org
.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
        at org
.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
        at oidc
.config.SessionConfig$$EnhancerBySpringCGLIB$$a114df44.mongoSessionConverter(<generated>)
        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:498)
        at org
.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        at org
.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)
        at org
.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:484)
        at org
.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)

Best regards,

Domingos Gonçalves



Domingos Gonçalves

unread,
Apr 15, 2020, 2:03:28 PM4/15/20
to OpenConext Community
Another thing happen is, the OIDC-NG broke after an error saying "Duplicate key com.nimbusds.jose.crypto.RSASSASigner@1080b026".

After a restart the OIDC-NG brokes all time after the error.

We solved this issue cleaning the OIDC-NG collections on MongoDB, restart OIDC-NG server and pressing PUSH on Manage to rebuild all data into MongoDB. After that it's working again.

The log error is the following:

2020-04-15 16:32:23,864  INFO [main] o.apache.coyote.http11.Http11NioProtocol:173 - Starting ProtocolHandler ["http-nio-9195"]
2020-04-15 16:32:23,951  INFO [main] o.s.b.w.embedded.tomcat.TomcatWebServer:204 - Tomcat started on port(s): 9195 (http) with context path ''
2020-04-15 16:32:23,959  INFO [main] oidc.OidcServerApplication:61 - Started OidcServerApplication in 23.041 seconds (JVM running for 24.835)
2020-04-15 16:32:24,802  INFO [main] o.s.b.a.l.ConditionEvaluationReportLoggingListener:136 -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-04-15 16:32:24,807 ERROR [main] o.springframework.boot.SpringApplication:826 - Application run failed
java
.lang.IllegalStateException: Duplicate key com.nimbusds.jose.crypto.RSASSASigner@1080b026
        at java
.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133)
        at java
.util.HashMap.merge(HashMap.java:1254)
        at java
.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
        at java
.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
        at java
.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
        at java
.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java
.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java
.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java
.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java
.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
        at oidc
.secure.TokenGenerator.initializeSigningKeys(TokenGenerator.java:185)
        at oidc
.secure.TokenGenerator.onApplicationEvent(TokenGenerator.java:167)
        at oidc
.secure.TokenGenerator.onApplicationEvent(TokenGenerator.java:87)
        at org
.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org
.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org
.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org
.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
        at org
.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
        at org
.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:98)
        at org
.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:71)
        at org
.springframework.boot.SpringApplication.run(SpringApplication.java:321)
        at org
.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
        at org
.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
        at oidc
.OidcServerApplication.main(OidcServerApplication.java:10)

        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:498)

        at org
.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org
.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org
.springframework.boot.loader.Launcher.launch(Launcher.java:51)
        at org
.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
2020-04-15 16:32:24,818  INFO [main] o.s.s.concurrent.ThreadPoolTaskScheduler:218 - Shutting down ExecutorService 'taskScheduler'
2020-04-15 16:32:24,820  WARN [main] o.s.b.f.support.DisposableBeanAdapter:267 - Invocation of destroy method failed on bean with name 'tomcatMetricsBinder': java.lang.NullPointerException
2020-04-15 16:32:24,821  INFO [main] o.s.s.concurrent.ThreadPoolTaskExecutor:218 - Shutting down ExecutorService 'applicationTaskExecutor'
2020-04-15 16:32:24,889  INFO [main] org.mongodb.driver.connection:71 - Closed connection [connectionId{localValue:8, serverValue:50}] to db01.qua.rctsaai.pt:27217 because the pool has been closed.
2020-04-15 16:32:24,906  INFO [main] org.mongodb.driver.connection:71 - Closed connection [connectionId{localValue:4, serverValue:48}] to db01.qua.rctsaai.pt:27217 because the pool has been closed.
2020-04-15 16:43:26,594  INFO [main] oidc.OidcServerApplication:55 - Starting OidcServerApplication v1.0.11 on japp01.qua.rctsaai.pt with PID 23029 (/opt/oidcng/oidcng-1.0.11.jar started by oidcng in /opt/oidcng)

Did you had any kind of errors like that before?

Best regards.

Domingos Gonçalves

Okke Harsta

unread,
Apr 16, 2020, 1:10:03 AM4/16/20
to openc...@googlegroups.com
Hi,

De stack trace is the result of having a DEBUG log level configured for Spring. It is only a debug message that it can load CasJackson2Module as OIDC-NG does not use it and it is not available on the class path. You can ignore this. It you want to suppress the message then you’ll need to change the LOG level for Spring in either /opt/oidcng/application.yml or in /opt/oidcng/logback.xml.

Rgds,
Okke

--
OpenConext - Open For Collaboration
---
You received this message because you are subscribed to the Google Groups "OpenConext Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openconext+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openconext/9daadf63-02ff-4ede-a20c-a6db95672645%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages