Теперь я хочу сделать то же самое, используя WLST ниже.
Код: Выделить всё
wladmin@remhost2:/web/bea_apps/domains/base_domain/servers/WLSJVM20$ cat startwlsapp.py
def stopApplication(application_name):
edit()
startEdit()
stopApplication(applicationName=application_name)
save()
activate(block="true")
def updateApplication(application_name, application_path):
edit()
startEdit()
app = getMBean('/AppDeployments/' + application_name)
#deploy(application_path, application_name) # Replace with the path to the updated application file
updateApplication(app, application_path)
save()
activate(block="true")
def startApplication(application_name):
edit()
startEdit()
startApplication(applicationName=application_name)
save()
activate(block="true")
application_name = sys.argv[1]
application_path = sys.argv[2]
print("Passed parameter to the WLST script is:", application_name)
connect('wladmin', 'wlspass', 't3://wlshost:12080')
stopApplication(application_name)
updateApplication(application_name, application_path)
startApplication(application_name)
Код: Выделить всё
wladmin@remhost2:/web/bea_apps/domains/base_domain/servers/WLSJVM20$ . ./setWLSEnv.sh
CLASSPATH=/web/bea/JAVA/lib/tools.jar:/web/bea/platform1223/wls1223/wlserver/modules/features/wlst.wls.classpath.jar:
PATH=/web/bea/platform1223/wls1223/wlserver/server/bin:/web/bea/platform1223/wls1223/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/web/bea/JAVA/jre/bin:/web/bea/JAVA/bin:/web/bea/JAVA/bin:/usr/bin:/usr/sbin:/web/bea/platform1223/wls1223/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
Your environment has been set.
wladmin@remhost2:/web/bea_apps/domains/base_domain/servers/WLSJVM20$ java weblogic.WLST startwlsapp.py myapp /web/bea_apps/applications/base_domain/MYAPPQA/myapp.ear
Код: Выделить всё
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
('Passed parameter to the WLST script is:', 'myapp')
Connecting to t3://wlshost:12080 with userid wladmin ...
Successfully connected to Admin Server "adminServer" that belongs to domain "base_domain".
Warning: An insecure protocol was used to connect to the server.
To ensure on-the-wire security, the SSL port or Admin port should be used instead.
Stopping application myapp.
.Completed the stop of Application with status completed
Current Status of your Deployment:
Deployment command type: stop
Deployment State : completed
Deployment Message : no message
Updating application myapp ...
java.io.IOException: java.io.CharConversionException: Malformed UTF-8 char -- is an XML encoding declaration missing?
Failed to update the application with status failed
Current Status of your Deployment:
Deployment command type: update
Deployment State : failed
Deployment Message : java.io.IOException: java.io.CharConversionException: Malformed UTF-8 char -- is an XML encoding declaration missing?
No stack trace available.
Problem invoking WLST - Traceback (innermost last):
File "/web/bea_apps/domains/base_domain/servers/WLSJVM20/startwlsapp.py", line 40, in ?
File "", line 330, in updateApplication
at weblogic.management.scripting.core.ExceptionCoreHandler.handleException(ExceptionCoreHandler.java:63)
at weblogic.management.scripting.WLSTUtils.throwWLSTException(WLSTUtils.java:338)
at weblogic.management.scripting.JSR88DeployHandler.updateApplication(JSR88DeployHandler.java:1053)
at weblogic.management.scripting.WLScriptContext.updateApplication(WLScriptContext.java:1060)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
weblogic.management.scripting.ScriptException: weblogic.management.scripting.ScriptException: Error occurred while performing updateApplication : Failed to update the application with status failed
Прием информации с https://serverfault.com/questions/ 686640/error-redeploying-in-wlst-only Я попробовал следующее.
У меня нет файла плана развертывания, поскольку все идет по умолчанию.
Я пробовал использовать аргументы имени, как показано ниже, но у меня возникла та же ошибка:
Код: Выделить всё
updateApplication(appName=application_name, appPath=application_path)
redeploy(application_name, appPath=application_path)
redeploy(application_name=application_name, path=application_path)
Примечание. Я могу успешно развернуть с помощью инструмента weblogic.Deployer ниже, однако мне нужно то же решение с использованием WLST
Код: Выделить всё
java weblogic.Deployer -adminurl t3://wlshost:12080 -username wladmin -password ******* -name myapp -deploy -source /web/bea_apps/applications/base_domain/MYAPPQA/myapp.ear
Подробнее здесь: https://stackoverflow.com/questions/786 ... lst-script