【问题标题】:can i indepent connect the wlst and use it's function on other script我可以独立连接 wlst 并在其他脚本上使用它的功能吗
【发布时间】:2014-03-19 09:20:21
【问题描述】:

我有一个脚本conn.py,在脚本中有一个名为conn()的函数,使用connect(username,password,url)连接weblogic域。并有一个脚本createServer.py

__main__: 
    import conn
conn.conn() 
cmo.createServer()

我在createServer() 上出现错误,在我运行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'

【问题讨论】:

  • 你遇到了什么错误?
  • You will need to be connected to a running server to execute this commandAttributeError: 'NoneType' object has no attribute 'createServer' 在运行 createServer() 之前绝对会断开连接
  • 请您过去整个跟踪跟踪吗?

标签: python wlst


【解决方案1】:

您能否检查一下 createServer.py",第 37、84 行中是否缺少任何参数。

【讨论】:

    【解决方案2】:

    WLST 连接函数设置了一些全局变量,这些变量在 python 中实际上是模块的全局变量——在你的例子中是 conn 模块——而不是整个 python 运行时。

    所以连接实际上是在你的 conn 模块的上下文中工作的。如果从 conn 模块内部调用其他依赖于并检查连接的 WLST 命令可能会起作用。

    但是,从您的 conn 模块记录该连接的全局变量对于您的主脚本或从那里调用的 WLST 命令是不可见的,因此从您的主脚本运行时需要连接的 WLST 命令会失败。

    【讨论】:

      猜你喜欢
      • 2010-10-25
      • 1970-01-01
      • 2019-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多