gpt4 book ai didi

session - hazelcast tomcat session 不从应用程序上下文加载类

转载 作者:行者123 更新时间:2023-11-28 22:26:43 24 4
gpt4 key购买 nike

我正在尝试在 tomcat 服务器上实现 hazelcast session 。
我在 tomcat7/lib 中放入了以下 jar :hazelcast-tomcat8-sessionmanager-1.0.3.jar,hazelcast-3.7.4.jar 和 hazelcast-client-3.7.4.jar。在 tomcat8/conf/server.xml 中我有:

<Listener className="com.hazelcast.session.ClientServerLifecycleListener" />

在 tomcat8/conf/Catalina/localhost/app.xml 中:

<Manager className="com.hazelcast.session.HazelcastSessionManager"
clientOnly="true"/>

似乎一切都很好,但是当我访问该应用程序时,我得到:

 29-Dec-2016 16:24:08.073 SEVERE [http-nio-8443-exec-8] org.apache.coyote.http11.AbstractHttp11Processor.process Error processing arequest
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: org.springframework.security.ui.savedrequest.SavedRequest
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:224)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:251)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:600)
at com.hazelcast.session.HazelcastSession.deserializeMap(HazelcastSession.java:141)
at com.hazelcast.session.HazelcastSession.readData(HazelcastSession.java:127)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:151)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:104)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:54)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:172)
at com.hazelcast.client.spi.ClientProxy.toObject(ClientProxy.java:186)
at com.hazelcast.client.proxy.ClientMapProxy.getInternal(ClientMapProxy.java:247)
at com.hazelcast.client.proxy.ClientMapProxy.get(ClientMapProxy.java:240)
at com.hazelcast.session.HazelcastSessionManager.findSession(HazelcastSessionManager.java:222)
at org.apache.catalina.connector.Request.isRequestedSessionIdValid(Request.java:2381)
at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1250)
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:935)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:523)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.security.ui.savedrequest.SavedRequest
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.hazelcast.nio.ClassLoaderUtil.tryLoadClass(ClassLoaderUtil.java:151)
at com.hazelcast.nio.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:120)
at com.hazelcast.nio.IOUtil$ClassLoaderAwareObjectInputStream.resolveClass(IOUtil.java:358)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:219)
... 26 more

有人知道我做错了什么吗?谢谢

最佳答案

似乎有什么东西改变了你当前线程的上下文 ClassLoader 所以 Hazelcast 的序列化服务找不到类。我创建了一个 issue为此,请访问 Hazelcast Tomcat Session Manager 的 GitHub 存储库。您可以在那里跟踪进度。

编辑:
您能否将 hazelcast-tomcat8-sessionmanager-1.0.3.jar 替换为 this page 上的 JAR?其中包括对问题的暂定修复,如果它解决了问题,请告诉我?

关于session - hazelcast tomcat session 不从应用程序上下文加载类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41381817/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com