【问题标题】:Unable to pass context root to .war application in websphere using wsadmin无法使用 wsadmin 将上下文根传递给 websphere 中的 .war 应用程序
【发布时间】:2017-07-14 07:31:10
【问题描述】:

在为我的 Websphere 8.5 应用服务器中的战争更新上下文根时,我需要一些帮助。我有一个名为 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>

正如上面代码中提到的,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 2.4 还是根本没有 web.xml?
  • @covener,在我的 war 文件中确实有 web.xml,指定了 Servlet 2.4

标签: ant automation websphere wsadmin installation-package


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    相关资源
    最近更新 更多