gpt4 book ai didi

使用 Memcached 的 Tomcat session 复制,ClassNotFoundException : com. esotericsoftware.kryo.pool.KryoFactory

转载 作者:行者123 更新时间:2023-11-28 22:17:47 25 4
gpt4 key购买 nike

Tomcat Session Replication with Memcached。使用 kryo 序列化。启动tomcat时出现错误。

centos6.5 上的 Apache Tomcat/7.0.69。Java 版本“1.7.0_101”。

tomcat错误:

SEVERE: The session manager failed to start
org.apache.catalina.LifecycleException: Failed to start component [de.javakaffee.web.msm.MemcachedBackupSessionManager[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5593)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Causeotericsoftware.kryo.pool.KryoFactorlassNotFoundExceptioncom.esotericsoftware.kryo.pool.KryoFactorlassNotFoundException: com.esotericsoftware.kryo.pool.KryoFactory
at de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory.getTranscoder(KryoTranscoderFactory.java:64)
at de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory.createTranscoder(KryoTranscoderFactory.java:47)
at de.javakaffee.web.msm.MemcachedSessionService.createTranscoderService(MemcachedSessionService.java:495)
at de.javakaffee.web.msm.MemcachedSessionService.startInternal(MemcachedSessionService.java:450)
at de.javakaffee.web.msm.MemcachedBackupSessionManager.startInternal(MemcachedBackupSessionManager.java:554)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.esotericsoftware.kryo.pool.KryoFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

tomcat的lib目录:

 annotations-api.jar
asm-3.2.jar
catalina-ant.jar
catalina-ha.jar
catalina.jar
catalina-tribes.jar
ecj-4.4.2.jar
el-api.jar
jasper-el.jar
jasper.jar
jsp-api.jar
kryo-1.04.jar
kryo-serializers-0.11.jar
memcached-session-manager-1.9.3.jar
memcached-session-manager-tc7-1.9.3.jar
minlog-1.2.jar
msm-kryo-serializer-1.9.3.jar
objenesis-1.4.jar
reflectasm-1.01.jar
servlet-api.jar
spymemcached-2.11.1.jar
tomcat7-websocket.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-jdbc.jar
tomcat-util.jar
websocket-api.jar

tomcat content.xml 修改:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:127.0.0.1:11211"
sticky="false"
lockingMode="auto"
sessionBackupAsync="false"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
sessionBackupTimeout="1000"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>

如何修复这个错误?谢谢。

最佳答案

您的 kryo jar (kryo-1.04.jar) 不包含 kryo-serializer 要求的依赖项,即 com.esotericsoftware.kryo.pool.KryoFactory .

您需要获得更新的 kyro 包才能使其正常工作,any of these应该完成这项工作。

关于使用 Memcached 的 Tomcat session 复制,ClassNotFoundException : com. esotericsoftware.kryo.pool.KryoFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37784083/

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