首先,創建一個模塊wl.py與如下因素代碼:你jms.py模塊中
# Caution: This file is part of the command scripting implementation.
# Do not edit or move this file because this may cause commands and scripts to fail.
# Do not try to reuse the logic in this file or keep copies of this file because this
# could cause your scripts to fail when you upgrade to a different version.
# Copyright (c) 2004,2014, Oracle and/or its affiliates. All rights reserved.
"""
This is WLST Module that a user can import into other Jython Modules
"""
from weblogic.management.scripting.utils import WLSTUtil
import sys
origPrompt = sys.ps1
theInterpreter = WLSTUtil.ensureInterpreter();
WLSTUtil.ensureWLCtx(theInterpreter)
execfile(WLSTUtil.getWLSTCoreScriptPath())
execfile(WLSTUtil.getWLSTNMScriptPath())
execfile(WLSTUtil.getWLSTScriptPath())
execfile(WLSTUtil.getOfflineWLSTScriptPath())
exec(WLSTUtil.getOfflineWLSTScriptForModule())
execfile(WLSTUtil.getWLSTCommonModulePath())
theInterpreter = None
sys.ps1 = origPrompt
modules = WLSTUtil.getWLSTModules()
for mods in modules:
execfile(mods.getAbsolutePath())
jmodules = WLSTUtil.getWLSTJarModules()
for jmods in jmodules:
fis = jmods.openStream()
execfile(fis, jmods.getFile())
fis.close()
wlstPrompt = "false"
接下來,導入這個模塊並調用這樣的WLST命令:WL。 cd('...')
你救了我的一天!對於我的情況應該是http://northernserve.ca/downloads/Oracle/Middleware/wlserver_10.3/common/wlst/modules/wlstModule.py – sancho21