Skip to content
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

Getting ClassNotFoundException after upgrading from 1.1.3 to 1.1.4/1.1.5 #111

Open
shashank929 opened this issue Mar 8, 2021 · 2 comments

Comments

@shashank929
Copy link

shashank929 commented Mar 8, 2021

Hello,

I am trying to use hazelcast-tomcat7-sessionmanager in client-server mode by connecting to hazelcast cluster which is running enterprise version 3.12. I am able to get it running except for a few use-cases where I saw errors related to :

Mar 07, 2021 11:48:27 PM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:35003B2FF6F8DDE5374B4A95597DDF08.localhost_abc

Since it looks related to #61 , I thought of upgrding from 1.1.13 to 1.1.14 but when I did that I am running into another basic issue where it is giving ClassNotFoundException for most of the classes:

Mar 07, 2021 11:55:01 PM com.hazelcast.session.HazelcastSession deserializeMap
WARNING: Unable to deserialize object in session
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.tester.abc.dto.user.UserInfo
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:88)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:77)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:269)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:574)
at com.hazelcast.session.HazelcastSession.deserializeMap(HazelcastSession.java:171)
at com.hazelcast.session.HazelcastSession.readData(HazelcastSession.java:156)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:160)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:106)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:51)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:187)
at com.hazelcast.client.spi.ClientProxy.toObject(ClientProxy.java:102)
at com.hazelcast.client.proxy.ClientMapProxy.getAll(ClientMapProxy.java:1196)
at com.hazelcast.session.HazelcastSessionManager.findSessions(HazelcastSessionManager.java:241)
at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:655)
at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:646)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1348)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5958)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.tester.abc.dto.user.UserInfo
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:288)
at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:252)
at com.hazelcast.nio.IOUtil$ClassLoaderAwareObjectInputStream.resolveClass(IOUtil.java:699)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1924)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1807)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2098)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1624)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:464)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:84)
... 23 more

It was working fine till 1.1.13 so definitely looks something related to #56 , #55 which were merged into 1.1.14

Can you please suggest what exactly might've caused it and what can be done to fix it?

@alparslanavci
Copy link
Contributor

Hi @shashank929, could you please share a reproducer with us? That would help us to investigate the issue easier.

@shashank929
Copy link
Author

Hi @alparslanavci ,

I am able to reproduce this issue by downloading tomcat from this link and then using a custom class to populate the record. The record gets populated fine but the above mentioned error is seen for every class whose object is in the record and that class being in the webapp/lib path.
I modified the SessionExample.java which comes along with the tomcat as a sample in /webapps/examples/WEB-INF/classes directory. Please place your own class in the same directory and use it for populating the record.
Once you populate the record then within few mins/seconds you'll be able to see the error stacktrace in logs. with 1.14 and 1.1.5 i am able to see the error but not with 1.1.3.
can it be something related to #58 ?

Thanks,
Shashank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants