com.mongodb.BasicDBObject cannot be cast to [B

After an upgrade from 3.3 to 4.0 I get the following error in the log after trying to login in the webgui:

2021-09-18T14:24:00.946+02:00 ERROR [ExecutorServiceSessionValidationScheduler] Error while validating the session
java.lang.ClassCastException: com.mongodb.BasicDBObject cannot be cast to [B at ~[graylog.jar:?]
at ~[graylog.jar:?]
at ~[graylog.jar:?]
at org.apache.shiro.session.mgt.DefaultSessionManager.getActiveSessions( ~[graylog.jar:?]
at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validateSessions( ~[graylog.jar:?]
at [graylog.jar:?]
at java.util.concurrent.Executors$ [?:1.8.0_292]
at java.util.concurrent.FutureTask.runAndReset( [?:1.8.0_292]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( [?:1.8.0_292]
at java.util.concurrent.ScheduledThreadPoolExecutor$ [?:1.8.0_292]
at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_292]
at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_292]
at [?:1.8.0_292]

How can I solve this issue?

Kind regards.

Michiel Piscaer

Hi there, this sounds like a corrupted session in MongoDB. You could try dropping the documents in the sessions collection to see if that does the trick.

Also, I want to mention this particular article: How to Post a Question in the Community that Gets Responses. We’ve put that together to make the process of asking and answering questions a bit less onerous for forum users. In the future, it would help if you can do things like:

  • Tell us how you upgraded, or provide steps for us to try and retrace
  • Surround your output with ``` to make it easier to read

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.