1

I deployed the HTTP Session management on WebShpere application as Peer to Peer model. I am trying to reset the defalut session timeout using cache-peer.xml file. However, it shows below error message.

java.lang.RuntimeException: EntryIdleTimeout is not the same
    at com.gemstone.gemfire.internal.cache.xmlcache.RegionAttributesCreation.sameAs(RegionAttributesCreation.java:391) ~[gemfire-8.0.0.jar:na]
    at com.gemstone.gemfire.modules.util.RegionHelper.validateRegion(RegionHelper.java:67) ~[gemfire-modules-8.0.jar:na]
    at com.gemstone.gemfire.modules.session.common.PeerToPeerSessionCache.createOrRetrieveRegion(PeerToPeerSessionCache.java:130) ~[gemfire-modules-session-8.0.jar:na]
    at com.gemstone.gemfire.modules.session.common.PeerToPeerSessionCache.initialize(PeerToPeerSessionCache.java:72) ~[gemfire-modules-session-8.0.jar:na]
    at com.gemstone.gemfire.modules.session.filter.GemfireSessionManager.initializeSessionCache(GemfireSessionManager.java:415) ~[gemfire-modules-session-8.0.jar:na]
    at com.gemstone.gemfire.modules.session.filter.GemfireSessionManager.start(GemfireSessionManager.java:132) ~[gemfire-modules-session-8.0.jar:na]
    at com.gemstone.gemfire.modules.session.filter.SessionCachingFilter.init(SessionCachingFilter.java:536) ~[gemfire-modules-session-external-8.0.jar:na]

Cache-peer.xml

<region name="gemfire_modules_sessions">
<region-attributes scope="distributed-ack" enable-gateway="false" data policy="replicate" statistics-enabled="true">
<entry-idle-time>
  <expiration-attributes timeout="600" action="invalidate"/>       
</entry-idle-time>
</region-attributes>
</region>

Any idea? I could not find the defalut setting.

4

1 回答 1

1

您不应使用区域定义来控制过期,而应使用标准部署描述符语义。例如在web.xml

<session-config>
    <!-- set session TTL to 30 seconds -->
    <session-timeout>30</session-timeout>
</session-config>

会话过期仍然由本地容器控制,该容器将在创建/销毁会话时发出适当的事件。GemFire HTTP 会话模块注册 aSessionListener并获取这些事件,必要时销毁底层缓存会话。

您还可以通过 Servlet API 在单个会话上设置 TTL:

HttpSession session = request.getSession();
session.setMaxInactiveInterval(30);
于 2015-06-11T21:35:33.443 回答