【问题标题】:How to undeploy the weblogic application using ant task?如何使用 ant 任务取消部署 weblogic 应用程序?
【发布时间】:2009-07-31 11:48:53
【问题描述】:

我必须通过 ant 在 weblogic 中部署我的应用程序。 我正在做的是:

<target name="deployOnServer1" >
        <echo>*********** Start deploying war file on SERVER1 *********** </echo>
        <wldeploy action="redeploy"
            source="${dist.dir}/${ant.project.name}.war" 
            name="${wls.appname}"      
            user="${wls1.user}" 
            password="${wls1.password}" 
            adminurl="${wls1.adminurl}"      
            targets="${wls1.targets}"
            verbose="true" 
            debug="true" 
            upload="true"
            remote="true"
        />
</target>

这会在 weblogic 上部署我的应用程序,前提是没有任何其他应用程序具有相同的应用程序上下文。 所以我做的是:

 <target name="undeployOnServer1">
            <echo>*********** Start unDeploying war file on SERVER1 *********** </echo>
        <wldeploy
        action="undeploy" verbose="true" debug="true"
         name="${wls.appname}"
        user="${wls1.user}" password="${wls1.password}" 
        adminurl="${wls1.adminurl}"      
        failonerror="false" 

        />
  </target>

并将 deployOnServer1 目标更改为

<target name="deployOnServer1" depends="undeployOnServer1">

但是现在在取消部署时它说, 没有名为“myapp”的应用程序可取消部署 并在部署时说, 无法部署,因为存在具有相同上下文路径“/myapp”的其他应用程序。

如何解决这个问题?

【问题讨论】:

    标签: deployment ant weblogic


    【解决方案1】:

    根据wldeploiy Ant Task Reference中的sample build.xml files for wldeploy,需要指定targets属性(除非应用程序部署在Administration Server实例上):

      <target name="undeploy">
        <wldeploy
          action="undeploy" verbose="true" debug="true"
          name="DeployExample"
          user="weblogic" password="weblogic"
          adminurl="t3://localhost:7001" targets="myserver"
          failonerror="false" />
      </target>
    

    这是targets属性的描述:

    目标服务器列表 应用程序已部署。
    此属性的值为 逗号分隔的目标列表 服务器、集群或虚拟 主机。
    如果您不指定 部署时的目标列表 应用程序,目标默认为 管理服务器 实例。

    【讨论】:

      【解决方案2】:

      我认为缺少此属性: 目标="${wls1.targets}"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-05
        • 1970-01-01
        • 2011-05-12
        相关资源
        最近更新 更多