2016-06-13 134 views
1

的Tomcat會話複製與Memcached的 使用KRYO序列化。 當啓動tomcat時,發生錯誤的Tomcat會話複製與Memcached的,ClassNotFoundException的:com.esotericsoftware.kryo.pool.KryoFactory

Apache Tomcat/7.0.69在centos6.5上。 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" 
    /> 

如何解決這個錯誤 感謝。

回答

1

您的kryo jar(kryo-1.04.jar)不包含kryo-serializer請求的依賴項,即com.esotericsoftware.kryo.pool.KryoFactory

您需要獲得最新的kyro軟件包才能正常工作,any of these應該完成這項工作。