用memcached实现session共享,tomcat启动不报错,浏览器访问就报错
时间: 2016-09-07来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>
在ubuntu虚拟机上用nginx+tomcat做负载均衡,为了实现session的共享,安装了memcached服务,并在tomcat的lib目录下导入了下列jar包:
asm-3.2.jar,couchbase-client-1.2.2.jar,kryo-1.03.jar,kryo-serializers-0.11.jar,memcached-session-manager-1.6.5.jar,memcached-session-manager-tc7-1.6.5.jar,minlog-1.2.jar,msm-kryo-serializer-1.6.5.jar,reflectasm-0.9.jar,spymemcached-2.10.3.jar
在tomcat的context.xml里面添加如下:
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:192.168.126.132:11211,n2:192.168.126.131:11211"
sticky="false"
sessionBackupAsync="false"
lockingMode="auto"
requestUriIgnorePattern=".*\.(png|gif|jpg|css|js){1}quot"
sessionBackupTimeout="1000"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>

tomca启动的时候没有报错,但是访问的时候就会报下面的错误,有没有知道的,求解啊!

Sep 06, 2016 6:09:45 PM de.javakaffee.web.msm.LockingStrategy onBackupWithoutLoadedSession WARNING: Found no validity info for session id 1F64837921904BFB8FA17328F56F75BC-n2Sep 06, 2016 6:09:45 PM org.apache.coyote.http11.AbstractHttp11Processor process SEVERE: Error processing request java.lang.NoSuchFieldError: attributes at de.javakaffee.web.msm.MemcachedBackupSession.getAttributesFiltered(MemcachedBackupSession.java:514) at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:108) at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:50) at de.javakaffee.web.msm.BackupSessionService$SynchronousExecutorService.submit(BackupSessionService.java:346) at de.javakaffee.web.msm.BackupSessionService.backupSession(BackupSessionService.java:205) at de.javakaffee.web.msm.MemcachedSessionService.backupSession(MemcachedSessionService.java:1076) at de.javakaffee.web.msm.RequestTrackingHostValve.backupSession(RequestTrackingHostValve.java:244) at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:173) at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:138) at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:138) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

热门排行