2017-07-14 54 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

感谢您的帮助..它的工作 –

相关问题