deploy Weblogic application with Ant

使用Ant脚本部署WebLogic应用
本文介绍如何使用Ant脚本实现WebLogic应用的部署流程,包括设置环境变量、定义任务、执行部署操作等关键步骤。
...
<taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy" classpath="${wls.home}\server\lib\weblogic.jar"/>
<wldeploy action="deploy" name="${appName}" targets="${serverName}" source="xx.ear" user="${wls.deploy.username}" password="${wls.deploy.password}" verbose="true" upload="true" />  
...

 

FYI: Ant Script to start server and deploy application

 

 

 

[wldeploy] weblogic.Deployer -noexit -name LkmNcEjbs -source /data/upload/LKM_Java_Apps/dev/ejb_apps/LkmNcEjbs.ear -targets MS1 -adminurl t3://132.147.180.94:7001 -user weblogic -password ******** -redeploy [wldeploy] weblogic.Deployer invoked with options: -noexit -name LkmNcEjbs -source /data/upload/LKM_Java_Apps/dev/ejb_apps/LkmNcEjbs.ear -targets MS1 -adminurl t3://132.147.180.94:7001 -user weblogic -redeploy [wldeploy] <Aug 1, 2025, 3:39:23 PM China Standard Time> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, LkmNcEjbs [archive: /data/upload/LKM_Java_Apps/dev/ejb_apps/LkmNcEjbs.ear], to MS1 .> [wldeploy] Task 1135 initiated: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Task 1135 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] weblogic.management.DeploymentException: The application LkmNcEjbs contains a SubDeploymentMBean with a name EngOperationEjb.jar however there is no module in the application with that URI or context-root. [wldeploy] [wldeploy] [wldeploy] weblogic.deploy.api.tools.deployer.DeployerException: Task 1135 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] weblogic.management.DeploymentException: The application LkmNcEjbs contains a SubDeploymentMBean with a name EngOperationEjb.jar however there is no module in the application with that URI or context-root. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:610) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:159) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:116) [wldeploy] at weblogic.Deployer.run(Deployer.java:74) [wldeploy] at weblogic.Deployer.mainWithExceptions(Deployer.java:63) [wldeploy] at weblogic.ant.taskdefs.management.DeployerWrapper.main(DeployerWrapper.java:14) [wldeploy] Exception in thread "main" weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 1135 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] weblogic.management.DeploymentException: The application LkmNcEjbs contains a SubDeploymentMBean with a name EngOperationEjb.jar however there is no module in the application with that URI or context-root. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.Deployer.run(Deployer.java:76) [wldeploy] at weblogic.Deployer.mainWithExceptions(Deployer.java:63) [wldeploy] at weblogic.ant.taskdefs.management.DeployerWrapper.main(DeployerWrapper.java:14) [wldeploy] Caused by: weblogic.deploy.api.tools.deployer.DeployerException: Task 1135 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] weblogic.management.DeploymentException: The application LkmNcEjbs contains a SubDeploymentMBean with a name EngOperationEjb.jar however there is no module in the application with that URI or context-root. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:610) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:159) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:116) [wldeploy] at weblogic.Deployer.run(Deployer.java:74) [wldeploy] ... 2 more
08-02
[wldeploy] <Aug 22, 2025, 4:25:14 PM China Standard Time> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, LkmNcEjbs [archive: /data/upload/LKM_Java_Apps/dev/ejb_apps/LkmNcEjbs.ear], to MS1 .> [wldeploy] Task 1581 initiated: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Task 1581 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] Unable to bind Business Interface to the JNDI name: LkmNcEjbsLkmOrderInfoEjb_jarMesPlateStatusBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name.; remaining name 'MesPlateStatusRemote#com/lkm/ejb/orderinfo/remote'. NestedException Message is :[EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name. [wldeploy] [wldeploy] [wldeploy] weblogic.deploy.api.tools.deployer.DeployerException: Task 1581 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] Unable to bind Business Interface to the JNDI name: LkmNcEjbsLkmOrderInfoEjb_jarMesPlateStatusBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name.; remaining name 'MesPlateStatusRemote#com/lkm/ejb/orderinfo/remote'. NestedException Message is :[EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:610) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:159) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:116) [wldeploy] at weblogic.Deployer.run(Deployer.java:74) [wldeploy] at weblogic.Deployer.mainWithExceptions(Deployer.java:63) [wldeploy] at weblogic.ant.taskdefs.management.DeployerWrapper.main(DeployerWrapper.java:14) [wldeploy] Exception in thread "main" weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 1581 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] Unable to bind Business Interface to the JNDI name: LkmNcEjbsLkmOrderInfoEjb_jarMesPlateStatusBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name.; remaining name 'MesPlateStatusRemote#com/lkm/ejb/orderinfo/remote'. NestedException Message is :[EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.Deployer.run(Deployer.java:76) [wldeploy] at weblogic.Deployer.mainWithExceptions(Deployer.java:63) [wldeploy] at weblogic.ant.taskdefs.management.DeployerWrapper.main(DeployerWrapper.java:14) [wldeploy] Caused by: weblogic.deploy.api.tools.deployer.DeployerException: Task 1581 failed: [Deployer:149026]deploy application LkmNcEjbs on MS1. [wldeploy] Target state: redeploy failed on Server MS1 [wldeploy] Unable to bind Business Interface to the JNDI name: LkmNcEjbsLkmOrderInfoEjb_jarMesPlateStatusBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name.; remaining name 'MesPlateStatusRemote#com/lkm/ejb/orderinfo/remote'. NestedException Message is :[EJB:011224]Unable to bind the interface com.lkm.ejb.orderinfo.remote.MesPlateStatusRemote to MesPlateStatusRemote. Another EJB has already bound an interface to that name. [wldeploy] [wldeploy] [wldeploy] [wldeploy] at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:610) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140) [wldeploy] at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:159) [wldeploy] at weblogic.utils.compiler.Tool.run(Tool.java:116) [wldeploy] at weblogic.Deployer.run(Deployer.java:74) [wldeploy] ... 2 more BUILD FAILED /data/upload/ncejb.xml:28: webLogic.Deployer execution failed
08-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值