wlst 离线添加用户到现有域

wlst offline add user to existing domain

我想使用 WLST 在离线模式下将用户添加到现有域。这可能吗? 我有以下脚本

readDomain(DOMAIN_HOME)
cd('/Security')
cd(DOMAIN_NAME)
cd('User')
user = create(USERNAME,"User")
user.setPassword(PASSWORD)

它吐出以下错误,我无法判断是正反面。

com.oracle.cie.domain.script.jython.WLSTException: Security info unavailable when a domain is read and no security type can be created.
    at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:69)
    at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:3085)
    at com.oracle.cie.domain.script.jython.WLScriptContext.cd(WLScriptContext.java:1451)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.oracle.cie.domain.script.jython.WLSTState.processCommand(WLSTState.java:226)
    at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:732)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyInstance.invoke(Unknown Source)
    at org.python.pycode._pyx5.command(/private/var/folders/05/lxzxmx693njf8gvh69p39nnr0000gn/T/WLSTOfflineIni3567769399441384102.py:19)
    at org.python.pycode._pyx5.call_function(/private/var/folders/05/lxzxmx693njf8gvh69p39nnr0000gn/T/WLSTOfflineIni3567769399441384102.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(PyFunction.java:184)
    at org.python.pycode._pyx5.cd(/private/var/folders/05/lxzxmx693njf8gvh69p39nnr0000gn/T/WLSTOfflineIni3567769399441384102.py:55)
    at org.python.pycode._pyx5.call_function(/private/var/folders/05/lxzxmx693njf8gvh69p39nnr0000gn/T/WLSTOfflineIni3567769399441384102.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(PyFunction.java:181)
    at org.python.pycode._pyx105.f[=11=](<console>:1)
    at org.python.pycode._pyx105.call_function(<console>)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyCode.call(Unknown Source)
    at org.python.core.Py.runCode(Py.java:1226)
    at org.python.core.Py.exec(Py.java:1252)
    at org.python.util.PythonInterpreter.exec(Unknown Source)
    at org.python.util.InteractiveInterpreter.runcode(Unknown Source)
    at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
    at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
    at weblogic.management.scripting.utils.WLSTInterpreter.runsource(WLSTInterpreter.java:1095)
    at weblogic.management.scripting.WLST.main(WLST.java:232)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at weblogic.WLST.main(WLST.java:47)
Caused by: java.lang.Exception: Security info unavailable when a domain is read and no security type can be created.
    at com.oracle.cie.domain.script.jython.WLScriptContext.blockSecurity4ReadDomain(WLScriptContext.java:3777)
    at com.oracle.cie.domain.script.jython.WLScriptContext.updateCmo(WLScriptContext.java:3376)
    at com.oracle.cie.domain.script.jython.WLScriptContext.cd(WLScriptContext.java:1441)
    ... 42 more

对于 WLST,这是不可能的。必须连接到管理服务器来完成安全配置。 另一种选择是创建域模板并包括您的用户。