[英]can i indepent connect the wlst and use it's function on other script
我有一個腳本conn.py
,該腳本中有一個名為conn()
的函數,該函數使用connect(username,password,url)
連接weblogic域。 並擁有一個腳本createServer.py
:
__main__:
import conn
conn.conn()
cmo.createServer()
並且我在createServer()
上收到錯誤消息,運行conn.conn()
后似乎自動斷開連接conn.conn()
,如何仍然可以通過這種方式使用WLST在線功能?
---------------------我的控制台返回-------------
starting the script ....
input your user name : weblogic
input your user password : weblogic456
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'demo'.
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.
connect OK.
You will need to be connected to a running server to execute this command
You will need to be connected to a running server to execute this command
Error: No domain or domain template has been read.
Problem invoking WLST - Traceback (innermost last):
File "/home/chopperlee/Program/Workspace/configWL/wlst/createServer.py", line 84, in ?
File "/home/chopperlee/Program/Workspace/configWL/wlst/createServer.py", line 37, in createServer
AttributeError: 'NoneType' object has no attribute 'createServer'
能否請您檢查一下createServer.py”,第37行,其中的所有缺少參數的地方84。
WLST connect函數設置一些全局變量,這些變量在python中實際上是模塊(在您的情況下為conn模塊)而不是整個python運行時的全局變量。
因此,連接實際上在conn模塊的上下文中起作用。 如果從conn模塊內部調用,則依賴於-並且檢查-連接的其他WLST命令可能也會起作用。
但是,從您的主腳本或從那里調用的WLST命令看不到記錄來自conn模塊的連接的全局變量,因此從主腳本運行時,需要連接的WLST命令失敗。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.