我需要一些幫助來更新我的Websphere 8.5應用服務器中的戰爭的上下文根。我有一個名爲DefaultApplication.war的war文件,在通過websphere console進行手動部署期間,iam能夠設置上下文根。現在我需要自動化當前流程,我選擇編寫ant腳本來安裝war文件。下面是代碼無法將上下文根傳遞給websphere中的.war應用程序使用wsadmin
<target name="installEAR" depends="uninstallEAR">
<fail unless="wasHome.dir">The property "wasHome.dir" must be specified.
</fail>
<fail unless="appName">The property "appName" must be specified.</fail>
<fail unless="deployEar">The property "deployEar" must be specified.</fail>
<echo message="Deployable EAR File found at: ${deployEar}" />
<wsInstallApp ear="${deployEar}"
options="-appname ${appName} -cell ${was.cell} -node ${was.node} -usedefaultbindings"
wasHome="${wasHome.dir}"
conntype="${connType}"
port="${port}"
host="${hostName}"
user="${userId}"
password="${password}"
failonerror="true" />
</target>
如上面代碼中提到,IAM設置-usedefaultbindings使用,我在war文件的WEB-INF文件夾的ibm-web的ext.xml文件。
上下文IBM的Web-ext.xml的:
<?xml version="1.0" encoding="UTF-8"?>
<web-ext
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_1.xsd"
version="1.1">
<context-root uri="test"/>
</web-ext>
部署後,我apllication是起步,但無法通過訪問它/測試上下文路徑。請幫助我。
在此先感謝。
您的web.xml是指定Servlet 2.4還是根本沒有web.xml? – covener
@covener,確實有我的戰爭文件中指定Servlet 2.4的web.xml 2.4 –