Weblogic缓存问题 [英] Weblogic caching problems

查看:75
本文介绍了Weblogic缓存问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 WLST 脚本来使用 WebLogic 11g 部署应用程序.问题是,当我部署应用程序(版本 A)时,取消部署它,然后部署版本 B,它部署版本 A.

I'm writing a WLST script to deploy an application with WebLogic 11g. The problem is that when I deploy an application (version A), undeploy it, then deploy version B, it deploys version A.

如果我尝试通过删除 tmp/_WL_user/appname/ 文件夹来解决此问题,则它不会部署 AB因为它在应用程序的 tmp 文件夹中查找(并且由于我清除了它而失败).我正在使用 nostage 选项,所以我不明白它为什么要缓存任何东西.

If I try to solve this by deleting the tmp/_WL_user/appname/ folder, it then won't deploy A or B because it looks in the tmp folder for the application (and fails because I cleared it out). I'm using the nostage option, so I don't understand why it's caching anything.

如果您能提供任何帮助,我们将不胜感激.谢谢!

Any help you can offer would be greatly appreciated. Thanks!

推荐答案

可能是版本 A 的取消部署没有成功,版本 B 从未部署过.

Probably the undeploy of Version A was not successful and Version B was never deployed.

不确定您在 WLST 脚本中有什么,您可以尝试以下操作:

Not sure what you have in the WLST script, could you try with the following:

# let's say the appName is testApp
# can move all of these properties to a props file
appName='testApp'
appPath='/scratch/user/testApp.war'
appTarget='AdminServer'
username='weblogic'
password='weblogic1'
adminURL='t3://hostname:adminport'

# start deploy/undeploy code
connect (username, password, adminURL)
for app in cmo.getAppDeployments():
    currAppName = app.getName()
    if currAppName == appName :
        print('Application' + appName + ' already exists, undeploying...')
        undeploy(appName)
        # sleep is just to make sure that we don't attempt deploy immediately i.e before server is finished with undeploying
        # more like a safe side one, may not be required also
        java.lang.Thread.sleep(60000)
print('Now deploying ' + appName)
deploy(appName, appPath, appTarget)
disconnect()

这篇关于Weblogic缓存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆