我使用的是Spring 4.0.3.RELEASE和EHcache 2.8.1.在JBoss 7.1.1上
在applicationContext.xml我的缓存中使用以下配置工作正常.
<cache:annotation-driven/>
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache"/>
</bean>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
现在我想用MBean添加监视功能.我更改了配置applicationContext.xml如下 - 添加了2个新bean"managementService"和"mbeanServer",没有其他更改.这是当前配置.
<cache:annotation-driven/>
<bean id="managementService"
class="net.sf.ehcache.management.ManagementService"
init-method="init"
destroy-method="dispose">
<constructor-arg ref="cacheManager"/>
<constructor-arg ref="mbeanServer"/>
<constructor-arg index="2" value="true"/>
<constructor-arg index="3" value="true"/>
<constructor-arg index="4" value="true"/>
<constructor-arg index="5" value="true"/>
</bean>
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache"/>
</bean>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml"/>
</bean>
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
使用此配置,我在应用程序服务器启动时收到以下错误.
14:05:32,208 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Context …Run Code Online (Sandbox Code Playgroud) 我有一个带有2个节点的JBoss AS7集群。我希望以零停机时间“更新”我的应用程序。[此应用尚未在生产中部署,尚处于开发阶段]
就我而言,在某些情况下,我需要进行计划外的部署。这种情况可能会在某些基础逻辑更改中发生[可能会在一两年中发生一次,在所有此类情况下,都不会进行会话结构更新,数据库结构也会发生更改等。]
以下是我计划中实现此目的的配置/步骤。
配置:
1.Session Replication is enabled.
2.Load balancing is done with Apache mod_jk.
3.JBoss AS 7.1 in standalone mode.
Run Code Online (Sandbox Code Playgroud)
脚步:
1. Take out node1 from the cluster.
2. Deploy new war file in node1.
3. Attach node1 in cluster.
4. Take out node2 from the cluster.
5. Deploy new war file in node2
6. Attach node2 in cluster.
Run Code Online (Sandbox Code Playgroud)
步骤3和步骤4之间的时间差可能会导致不一致,因为两个版本的应用程序将同时启动并运行。
实现零停机时间还有哪些其他选择?
[这是一个基于Spring的Web应用程序]
谢谢。
我有一个 JSF-Spring 集成应用程序。此应用程序中还集成了 Spring 安全性。这些是我的应用程序中的版本:
根据JSF 文档,JSF2.x [甚至旧版本] 中的所有 POST 请求都将受到 CSRF 保护。但是,我能够通过 CSRF 攻击来渗透我的应用程序。
我只尝试了一个不同的 JSF2.2 [没有 Spring] 示例应用程序,在这种情况下,我可以看到这个示例应用程序受 CSRF 保护。
所以我的理解是,JSF/Spring/Spring 安全组合在我的原始应用程序中出现了问题。不幸的是,日志文件中没有帮助信息。
我可以尝试使用Spring Security CSRF 保护。在那种情况下,挑战是我需要在所有 POST 情况下编辑代码。
我希望启用 JSF CSRF 保护以避免此代码更改。有什么建议吗?
我正在用Pinata进行测试。