[英]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.