title: Creating Portable Weblogic Scripting Tool
body: <p>I want to create WLST to do scripting in my server because I don't have the access to the wlst.sh. I used the WLST to execute a script that deploy a war file. When I execute it with:</p>
  
  <pre><code>java -cp $(echo lib/*.jar | tr ' ' ':') -Dprod.props.file=lib/props.txt -Dbea.home= -Dweblogic.home=/drives/app/wlst weblogic.WLST /drives/app/wlst/deploy.py
  </code></pre>
  
  <p>I can deploy my war file (the script is working), but it shows error before and after it execute the script.</p>
  
  <p>This question is similiar too <a href="https://stackoverflow.com/questions/11098841/how-can-i-create-a-portable-weblogic-scripting-tool-application">this</a>, but since the question is already answered and seems outdated (I use Weblogic 12.2.1.3.0) I ask this question.</p>
  
  <p>The module I included are:</p>
  
  <pre><code>    ├── lib
      │   ├── com.bea.core.xml.xmlbeans_1.0.0.0_2-6-0-12.1.3-0-0.jar
      │   ├── com.oracle.cie.comdev_7.8.2.0.jar
      │   ├── com.oracle.cie.config_8.6.0.0.jar
      │   ├── com.oracle.cie.config-owsm_8.6.0.0.jar
      │   ├── com.oracle.cie.config-security_8.6.0.0.jar
      │   ├── com.oracle.cie.config-wls_8.6.0.0.jar
      │   ├── com.oracle.cie.config-wls-schema_8.6.0.0.jar
      │   ├── com.oracle.cie.dependency_1.8.2.0.jar
      │   ├── com.oracle.cie.encryption_2.6.0.0.jar
      │   ├── com.oracle.cie.service-table_1.6.0.0.jar
      │   ├── com.oracle.cie.wizard_7.8.2.0.jar
      │   ├── com.oracle.core.weblogic.msgcat-12.2.1-3-0.jar
      │   ├── com.oracle.glcm.encryption_2.7.2.0.jar
      │   └── jython-modules.jar
      │   └── weblogic.jar
      │   └── wlfullclient.jar
  </code></pre>
  
  <p>This is the error I get it execute my script:</p>
  
  <pre><code>java.lang.ClassNotFoundException: com.oracle.cie.gdr.external.InventoryFactory
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at com.oracle.cie.common.ReflectionHelper.process(ReflectionHelper.java:43)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:384)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.&lt;init&gt;(EnvironmentServiceImpl.java:89)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.getInstance(EnvironmentServiceImpl.java:364)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:35)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:72)
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:303)
          at com.oracle.cie.domain.script.jython.WLScriptContext.setup(WLScriptContext.java:270)
          at com.oracle.cie.domain.script.jython.WLST_offline.setupContext(WLST_offline.java:46)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.management.scripting.utils.WLSTUtil.initOfflineContext(WLSTUtil.java:514)
          at weblogic.management.scripting.utils.WLSTUtil.setupOfflineInternal(WLSTUtil.java:488)
          at weblogic.management.scripting.utils.WLSTUtil.setupOffline(WLSTUtil.java:361)
          at weblogic.management.scripting.utils.WLSTUtilWrapper.setupOffline(WLSTUtilWrapper.java:29)
          at weblogic.management.scripting.utils.WLSTInterpreter.&lt;init&gt;(WLSTInterpreter.java:250)
          at weblogic.management.scripting.WLST.main(WLST.java:134)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.WLST.main(WLST.java:47)
  
  java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.management.scripting.utils.WLSTUtil.initOfflineContext(WLSTUtil.java:514)
          at weblogic.management.scripting.utils.WLSTUtil.setupOfflineInternal(WLSTUtil.java:488)
          at weblogic.management.scripting.utils.WLSTUtil.setupOffline(WLSTUtil.java:361)
          at weblogic.management.scripting.utils.WLSTUtilWrapper.setupOffline(WLSTUtilWrapper.java:29)
          at weblogic.management.scripting.utils.WLSTInterpreter.&lt;init&gt;(WLSTInterpreter.java:250)
          at weblogic.management.scripting.WLST.main(WLST.java:134)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.WLST.main(WLST.java:47)
  Caused by: java.lang.IllegalStateException: com.oracle.cie.domain.env.EnvironmentServiceException: Failed to get inventory for /drives
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:353)
          at com.oracle.cie.domain.script.jython.WLScriptContext.setup(WLScriptContext.java:270)
          at com.oracle.cie.domain.script.jython.WLST_offline.setupContext(WLST_offline.java:46)
          ... 15 more
  Caused by: com.oracle.cie.domain.env.EnvironmentServiceException: Failed to get inventory for /drives
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:425)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.&lt;init&gt;(EnvironmentServiceImpl.java:89)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.getInstance(EnvironmentServiceImpl.java:364)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:35)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:72)
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:303)
          ... 17 more
  Caused by: java.lang.ClassNotFoundException: com.oracle.cie.gdr.external.InventoryFactory
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at com.oracle.cie.common.ReflectionHelper.process(ReflectionHelper.java:43)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:384)
          ... 22 more
  Error execing the Python script "/drives/app/wlst/lib/wlfullclient.jar!/wlstScriptDir/jrf_mt_provisioning_cli.py" caused an error "Traceback (innermost last):
    File "/drives/app/wlst/lib/wlfullclient.jar!/wlstScriptDir/jrf_mt_provisioning_cli.py", line 19, in ?
  ImportError: no module named lifecycle
  "
  Error execing the Python script "/drives/app/wlst/lib/wlfullclient.jar!/wlstScriptDir/coh_persistence.py" caused an error "Traceback (innermost last):
    File "/drives/app/wlst/lib/wlfullclient.jar!/wlstScriptDir/coh_persistence.py", line 14, in ?
  ImportError: no module named datagrid
  "
  </code></pre>
  
  <p>And this is the error I get after it execute my script:</p>
  
  <pre><code>SEVERE: Failed to get inventory for /drives
  java.lang.ClassNotFoundException: com.oracle.cie.gdr.external.InventoryFactory
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at com.oracle.cie.common.ReflectionHelper.process(ReflectionHelper.java:43)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:384)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.&lt;init&gt;(EnvironmentServiceImpl.java:89)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.getInstance(EnvironmentServiceImpl.java:364)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:35)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:72)
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:303)
          at com.oracle.cie.domain.script.jython.WLScriptContext.setup(WLScriptContext.java:270)
          at com.oracle.cie.domain.script.jython.WLST_offline.setupContext(WLST_offline.java:46)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.management.scripting.utils.WLSTUtil.initOfflineContext(WLSTUtil.java:514)
          at weblogic.management.scripting.utils.WLSTUtil.setupOfflineInternal(WLSTUtil.java:488)
          at weblogic.management.scripting.utils.WLSTUtil.setupOffline(WLSTUtil.java:361)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.python.core.PyReflectedFunction.__call__(Unknown Source)
          at org.python.core.PyReflectedFunction.__call__(Unknown Source)
          at org.python.core.PyObject.__call__(Unknown Source)
          at org.python.core.PyObject.invoke(Unknown Source)
          at org.python.pycode._pyx24.disconnect$2(&lt;iostream&gt;:140)
          at org.python.pycode._pyx24.call_function(&lt;iostream&gt;)
          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__(Unknown Source)
          at org.python.pycode._pyx23.f$0(/drives/app/wlst/deploy.py:25)
          at org.python.pycode._pyx23.call_function(/drives/app/wlst/deploy.py)
          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.util.PythonInterpreter.execfile(Unknown Source)
          at weblogic.management.scripting.WLST.main(WLST.java:186)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.WLST.main(WLST.java:47)
  
  java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.management.scripting.utils.WLSTUtil.initOfflineContext(WLSTUtil.java:514)
          at weblogic.management.scripting.utils.WLSTUtil.setupOfflineInternal(WLSTUtil.java:488)
          at weblogic.management.scripting.utils.WLSTUtil.setupOffline(WLSTUtil.java:361)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.python.core.PyReflectedFunction.__call__(Unknown Source)
          at org.python.core.PyReflectedFunction.__call__(Unknown Source)
          at org.python.core.PyObject.__call__(Unknown Source)
          at org.python.core.PyObject.invoke(Unknown Source)
          at org.python.pycode._pyx24.disconnect$2(&lt;iostream&gt;:140)
          at org.python.pycode._pyx24.call_function(&lt;iostream&gt;)
          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__(Unknown Source)
          at org.python.pycode._pyx23.f$0(/drives/app/wlst/deploy.py:25)
          at org.python.pycode._pyx23.call_function(/drives/app/wlst/deploy.py)
          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.util.PythonInterpreter.execfile(Unknown Source)
          at weblogic.management.scripting.WLST.main(WLST.java:186)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at weblogic.WLST.main(WLST.java:47)
  Caused by: java.lang.IllegalStateException: com.oracle.cie.domain.env.EnvironmentServiceException: Failed to get inventory for /drives
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:353)
          at com.oracle.cie.domain.script.jython.WLScriptContext.setup(WLScriptContext.java:270)
          at com.oracle.cie.domain.script.jython.WLST_offline.setupContext(WLST_offline.java:46)
          ... 33 more
  Caused by: com.oracle.cie.domain.env.EnvironmentServiceException: Failed to get inventory for /drives
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:425)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.&lt;init&gt;(EnvironmentServiceImpl.java:89)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.getInstance(EnvironmentServiceImpl.java:364)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:35)
          at com.oracle.cie.domain.env.EnvironmentServiceFactory.getEnvironmentService(EnvironmentServiceFactory.java:72)
          at com.oracle.cie.domain.script.jython.WLScriptContext.init(WLScriptContext.java:303)
          ... 35 more
  Caused by: java.lang.ClassNotFoundException: com.oracle.cie.gdr.external.InventoryFactory
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at com.oracle.cie.common.ReflectionHelper.process(ReflectionHelper.java:43)
          at com.oracle.cie.domain.env.EnvironmentServiceImpl.init(EnvironmentServiceImpl.java:384)
          ... 40 more
  </code></pre>
  
  <p>My other reference is <a href="https://community.oracle.com/thread/2364978?start=0" rel="nofollow noreferrer">this thread</a>.</p>
  
  <p>My question is, is it possible to solve this error? I know that the error didn't impact my script, but it would be nice to remove this error. I was thinking maybe I miss some module to include, but I can't figure out what's the module I'm looking for.</p>