A context with a dash in it and storageKeyPrefix="context" breaks MSM
Whenever an application context has a dash in it (eg. my-program), and the setting storageKeyPrefix is set to "context" MSM will not work. The following error will occur:
2017-05-11 00:27:05,876 DEBUG [de.javakaffee.web.msm.RequestTrackingHostValve] (http-nio-127.0.0.1-8080-exec-1) >>>>>> Request starting: GET /my-program/test (requestedSessionId null) ================== 2017-05-11 00:27:05,989 DEBUG [de.javakaffee.web.msm.MemcachedBackupSessionManager$1] (http-nio-127.0.0.1-8080-exec-1) createSession invoked: null 2017-05-11 00:27:05,993 DEBUG [de.javakaffee.web.msm.SessionIdFormat] (http-nio-127.0.0.1-8080-exec-1) Creating new session id with orig id 'ping' and memcached id 'n2'. 2017-05-11 00:27:06,000 DEBUG [de.javakaffee.web.msm.NodeAvailabilityCache] (http-nio-127.0.0.1-8080-exec-1) CacheLoader returned node availability 'false' for node 'n2'. 2017-05-11 00:27:06,001 DEBUG [de.javakaffee.web.msm.SessionIdFormat] (http-nio-127.0.0.1-8080-exec-1) Creating new session id with orig id 'ping' and memcached id 'n1'. 2017-05-11 00:27:06,001 DEBUG [de.javakaffee.web.msm.NodeAvailabilityCache] (http-nio-127.0.0.1-8080-exec-1) CacheLoader returned node availability 'false' for node 'n1'. 2017-05-11 00:27:06,001 DEBUG [de.javakaffee.web.msm.SessionIdFormat] (http-nio-127.0.0.1-8080-exec-1) Creating new session id with orig id '1E6ACB06B519D5BB2069D65798B1D29B' and memcached id 'null'. 2017-05-11 00:27:06,002 DEBUG [de.javakaffee.web.msm.MemcachedBackupSessionManager$1] (http-nio-127.0.0.1-8080-exec-1) Created new session with id 1E6ACB06B519D5BB2069D65798B1D29B 2017-05-11 00:27:06,877 DEBUG [de.javakaffee.web.msm.BackupSessionService] (http-nio-127.0.0.1-8080-exec-1) Starting for session id 1E6ACB06B519D5BB2069D65798B1D29B 2017-05-11 00:27:06,877 DEBUG [de.javakaffee.web.msm.BackupSessionService] (http-nio-127.0.0.1-8080-exec-1) Skipping backup for session id 1E6ACB06B519D5BB2069D65798B1D29B as the session id is not usable for memcached. 2017-05-11 00:27:06,879 DEBUG [de.javakaffee.web.msm.RequestTrackingHostValve] (http-nio-127.0.0.1-8080-exec-1) Request finished, with Set-Cookie header: JSESSIONID=1E6ACB06B519D5BB2069D65798B1D29B; Path=/my-program/; HttpOnly 2017-05-11 00:27:06,879 DEBUG [de.javakaffee.web.msm.RequestTrackingHostValve] (http-nio-127.0.0.1-8080-exec-1) <<<<<< Request finished: GET /my-program/test ==================
My config:
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" memcachedNodes="n1:servera:11211,n2:serverb:11211" failoverNodes="${msm.failover.nodes}" storageKeyPrefix="context" memcachedProtocol="binary" requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory" enabled="true" />
Used version: `memcached-session-manager-2.1.1.jar memcached-session-manager-tc7-2.1.1.jar spymemcached-2.11.1.jar
On Tomcat 7.0.70 ` Not a big problem for me, but would be handy (eg. gather stats in memcached) if it was possible to use the context as a prefix.
Thanks for reporting this! Do you want to submit a PR?
Nah.., I'm not a programmer/developer. You wouldn't want me to write code for this project (or hear me sing a song either ;-) ).