Ant 无法使用wsadmin将上下文根传递给websphere中的.war应用程序

Ant 无法使用wsadmin将上下文根传递给websphere中的.war应用程序,ant,automation,websphere,wsadmin,installation-package,Ant,Automation,Websphere,Wsadmin,Installation Package,我需要一些帮助来更新WebSphere8.5AppServer中war的上下文根。我有一个名为DefaultApplication.war的war文件,在通过websphere控制台进行手动部署期间,我能够设置上下文根。现在我有了自动化当前流程的要求,我选择编写ant脚本来安装war文件。下面是代码 <target name="installEAR" depends="uninstallEAR"> <fail unless="wasHome.dir">The proper

我需要一些帮助来更新WebSphere8.5AppServer中war的上下文根。我有一个名为DefaultApplication.war的war文件,在通过websphere控制台进行手动部署期间,我能够设置上下文根。现在我有了自动化当前流程的要求,我选择编写ant脚本来安装war文件。下面是代码

<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>

必须指定属性“wasHome.dir”。
必须指定属性“appName”。
必须指定属性“deployEar”。
正如上面代码中提到的,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>

部署后,我的应用程序正在启动,但无法通过/test上下文路径访问它。请帮我做这个


提前感谢。

您必须在web.xml中指定Servlet 3.0或3.1,否则不会解释ibm-web-ext.xml。对于2.4,将解释名为ibm-web-ext.xmi的类似文件。

您的web.xml是指定Servlet 2.4还是根本不指定web.xml?@covener,我的war文件中是否有指定Servlet 2.4的web.xml