WebLogic Deployment Bug or Feature?

If you’ve haven’t run into this issue yet, you’ll appreciate this little nugget. I’m not sure if this is a feature or a bug in WebLogic’s deployment infrastructure. I ran into this issue a while back and completely forgot about it, till I ran into it this weekend.

A little background first: Most people that deploy WebLogic in a corporate environment take advantage of the concept of domains, admin and managed servers. A domain is the basic administration unit for WebLogic Server instances and consists of one or more WebLogic Server instances (and their associated resources) that you manage with a single Administration Server. For application deployment mode, WebLogic offers the ability to ’stage’ your applications on the Administration server, which determines how the deployment files (ear, war, etc) are made available to target servers. WebLogic Server provides three different options for staging files: stage mode, nostage mode, and external_stage mode. I personally prefer and use the stage mode where the admin server first copies the deployment unit source files to the staging directories of target servers. The target (managed) servers then deploy using their local copy of the deployment files using the redeploy feature or via a simple staggered restart. This allows for clean deployment across the cluster and HttpSession replication allows users to failover without taking an outage of the application.

This really works well unless you add another ejb jar or war file to your existing, deployed and targeted application. So I just added a new

customer.war

file to my existing ear file and modified the

application.xml

to appropriately list the new web module. You would think that deploying the new ear file with the new war file would work as expected, but alas it doesn’t. WebLogic will redeploy the new ear file but not target and deploy the new war file as it wasn’t explicitly deployed using the WebLogic deploy tool or the console. The managed or target servers will have the new code but the new war or ejb jar just won’t be targeted and deployed on that server. Bizarre, right? I think so but I am not sure if this is a bug or a feature. To correctly target and deploy a new module that’s part of an existing and currently targeted/deployed application, you will need to use weblogic.Deployer tool to tell WebLogic about the new addition to the existing ear file. Sample command:

 

java weblogic.Deployer -adminurl http://admin:8001 -username xxx -password xxx -deploy -targets customer@app_name -name app_name -source ./applications/app_name.ear

 

More information about weblogic.Deployer is @ http://e-docs.bea.com/wls/docs81/deployment/tools.html#999152

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值