公司的網站系統使用的中間是jboss7.1.1 Final,由於有些數據和服務測試環境不具備,免不了要在測試環境調試些jsp頁面,發現從jboss社區里下載的jboss應用有個問題,新增jsp頁面會實時部署,修改過的jsp頁面就無法正常部署。
最新查到了如下解決方式:
在jboss7\standalone\configuration\standalone.xml文件中找到<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">做如下配置
- <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host"> <configuration> <jsp-configuration development="true"/> </configuration> <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem>
以打開開發模式。但是加上該代碼后,發現不起作用。后面有到jboss社區里翻了無數帖子,發現了Tomaz Cerar如下描述:
in 7.1.1 we have included much reworked web subsystem but unfortunaly I missed a bit that coused all jsp configuration to be ignored.
That bug was fixed soon after 7.1.1 was released and is now part of 7.1.2 and 7.2.x development branch.
原味連接https://community.jboss.org/message/723813由此可見這是一個本版本的bug,說是要在后期修復的。但是為中間升級風險很大,很多業務都是基於老版本的開發的,為了穩妥,我想肯定有人不用通過升級已經解決了此問題。
燈火闌珊處,發現了答案:
1. Please make sure to add
<configuration>
<jsp-configuration development="true"/>
</configuration>
in standalone.xml under <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
2. Go to jboss-as-7.1.1.Final/modules/org/jboss/as/web/main
Place the jboss-as-web-7.1.1.Final-RECOMPILE.jar in there. You can download from http://www.datafilehost.com/download-2cb9ff04.html
3. Open module.xml (jboss-as-7.1.1.Final/modules/org/jboss/as/web/main) and add the following line
<!--resource-root path="jboss-as-web-7.1.1.Final.jar"/-->
<resource-root path="jboss-as-web-7.1.1.Final-RECOMPILE.jar"/>
敘述的都很簡單,我就不翻譯了
原文詳見:https://community.jboss.org/message/723945#723945#723945
按照作者所講的方法操作了,問題奇跡般解決了,當時由於jboss核心包被重新編譯過了,是否存在什么隱患還有待深入測試。
另在附件中提供了解決方案提供者重新編譯過的包,我測試了是沒問題。
現與大家分享。
原文:http://andy-li-chn.iteye.com/blog/1966986

