按照官网的文档安装了memcached之后,把memcached-session-manager-1.9.2.jar、memcached-session-manager-tc7-1.9.2.jar、spymemcached-2.11.1.jar三个jar包放到tomcat下面之后。用的是java序列化。配置如下
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:127.0.0.1:11211" sticky="false" requestUriIgnorePattern= ".*.(png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory" />
然后一点进项目就报错,启动tomcat的时候没报错。一访问项目就报错。有没有懂的朋友帮忙看看什么原因啊。de.javakaffee.web.msm.MemcachedBackupSession.getAttributesFiltered这个类在memcached-session-manager-1.9.2.jar里面有啊,方法也有。为什么会报这个错误呢?
SEVERE: Error processing request java.lang.NoSuchFieldError: attributes
at de.javakaffee.web.msm.MemcachedBackupSession.getAttributesFiltered(MemcachedBackupSession.java:515)
at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:109)
at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:51)
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:1030)
at de.javakaffee.web.msm.RequestTrackingHostValve.backupSession(RequestTrackingHostValve.java:230)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:159)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:124)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:124)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:124)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:124)
at de.javakaffee.web.msm.RequestTrackingHostValve.invoke(RequestTrackingHostValve.java:124)
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)
jar包没加全,我也用的这个同步session 但是比你多了好几个jar, 回复 @仁江 : asm-3.2.jar、kryo-1.04.jar、kryo-serializers-0.11.jar、minlog-1.2.jar、msm-kryo-serializer-1.8.2.jar、reflectasm-1.01.jar还差这几个######回复 @醉枫染墨丷 : 没解决,不知道是不是和我用的jdk或者tomcat版本有关。最后用了nginx_upstream_jvm_route模板解决了######回复 @仁江 : 兄弟,你这个问题解决了吗######回复 @雲竹無心 : 能把你的jar包发我一下吗。我用的是tomcat7,jdk7.我感觉是不是这些jar包的版本有问题。我把那些jar包都加进去之后运行总是报错######回复: @仁江 是的######回复 @雲竹無心 : 这些包也是放tomcat的lib就行了吗###### 题主,你这个问题解决了么?
我这边也是酱紫, content里配置成sticky session没问题. 配置成非sticky以后, 每次进项目会读写memcache, 于是就会这样. ######没解决呢,你试一下换jdk8试试,这个兼容性感觉太不好了
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。