2017-07-14 73 views
1

我需要一些幫助來更新我的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是起步,但無法通過訪問它/測試上下文路徑。請幫助我。

在此先感謝。

+0

您的web.xml是指定Servlet 2.4還是根本沒有web.xml? – covener

+0

@covener,確實有我的戰爭文件中指定Servlet 2.4的web.xml 2.4 –

回答

0

您必須在web.xml中指定Servlet 3.0或3.1,否則ibm-web-ext.xml將不會被解釋。對於2.4,名爲ibm-web-ext.xmi的類似文件將被解釋。

+0

感謝您的幫助..它的工作 –

相關問題