【问题标题】:WLST: cannot call edit functions when you are not in the edit treeWLST:当您不在编辑树中时无法调用编辑函数
【发布时间】:2018-06-13 07:37:00
【问题描述】:

我正在尝试运行以下 WLST 脚本

import java.lang
import os
import string

# 1 - Connecting to the Destination
connect(username,password,server_url)

edit()

# 2 - Security Realm
print ""
print "================== Seucrity Realm ==================="
startEdit()
serverConfig()

ap = cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvid
er('DefaultAuthenticator')

print "Create group " + user_group
ap.createGroup(user_group, user_group)

print "Craete user " + user_name
ap.createUser(user_name, user_pass, user_name)

print "Add user " + user_name + " to group " + user_group
ap.addMemberToGroup(user_group, user_name)

print "Create global role " + user_role

rm = cmo.getSecurityConfiguration().getDefaultRealm().lookupRoleMapper('XACMLRol
eMapper')
rm.createRole(None, user_role, None)
rm.setRoleExpression(None, user_role, 'Grp(' + user_group + ')')

# Save, activate and exit
# ==========================
print ""
save()
activate()
exit()

但得到错误

No stack trace available.
Problem invoking WLST - Traceback (innermost last):
  File "/u01/oracle/security-realm-config.py", line 40, in ?
  File "<iostream>", line 510, in save
  File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing save : Cannot call Edit functions
 when you are not in the Edit tree.

脚本仍然有效,但为什么会打印此错误,以及如何避免?

【问题讨论】:

    标签: jakarta-ee weblogic weblogic12c wlst


    【解决方案1】:

    问题在于“serverConfig()”行。您从编辑上下文切换到“新”mbean 树,该树不处于可编辑状态。将您的 serverConfig() 行移到 edit() 命令之前,或者将其完全删除,因为 serverConfig 树是连接后的默认树。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-28
      • 1970-01-01
      • 2012-07-23
      • 2014-07-14
      • 2011-09-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多