我在weblogic中部署了2个应用程序:
app1: target1, target2
app2: target3
为了将target2分配给app2,我执行下一个wlst命令:
connect('user', 'password', 't3://admin-address:admin-port')
undeploy("app1", targets="target2")
disconnect()
readDomain('domain-dir')
assign("AppDeployment","app2","Target","target2")
updateDomain()
closedomain()
没有错误,但只能从target2取消部署app1。有人可以在这帮忙吗?
答案 0 :(得分:0)
最终的解决方案是:
connect('user', 'password', 't3://<admin_server>:<admin_port>')
# remove target from the first application
edit()
startEdit()
cd('/AppDeployments/app1')
set('Targets',jarray.array([ObjectName('com.bea:Name=target1,Type=Server')], ObjectName))
activate()
exit()
# add target to the second application
edit()
startEdit()
cd('/AppDeployments/app2')
set('Targets',jarray.array([ObjectName('com.bea:Name=target2,Type=Server'), ObjectName('com.bea:Name=target3,Type=Server')], ObjectName))
activate()
exit()