創建WEB-INF/jboss-web.xml文件,全部內容如下:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>
修改/jboss-as-7.0.0.Final/standalone/configuration/standalone.xml文件
在文件的最後找到
<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
<connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost" />
<alias name="example.com" />
</virtual-server>
</subsystem>
將enable-welcome-root="true"刪除或改爲enable-welcome-root="false"
否則啓動時會拋出"Child container with name already exists"錯誤
轉自:http://exceedsun218.iteye.com/blog/1150927