问题描述
我正在创建 WLST 脚本,该脚本将针对运行相当锁定的 weblogic 的服务器运行.除非预先授权的更改,否则我只有查看日志的权限和对控制台的只读访问权限.我无权访问整个 weblogic 域并运行 WLST.
I am creating WLST scripts which will be run against a server running weblogic which is fairly locked down. I only have permission to view logs and read only access to the console unless a pre-authorised change. I don't have permission to access the entire weblogic domain and run WLST.
我想在安装了 Java 但没有安装 Weblogic 的不同服务器上运行 WLST.
I would like to run WLST on a differernt server which has Java installed but not Weblogic.
我最初希望在类路径中添加一个 weblogic jar,然后运行该工具,但它似乎有点复杂.
I was initially hoping to add a weblogic jar to the classpath then run the tool but it seems a bit more complicated that that.
我一直在遵循这些说明但没有成功.
I have been following these instructions without success.
我当前的设置是以下目录结构,其中包含来自 weblogic 12.1.1 的 jar:
My current setup is this directory structure with jars taken from weblogic 12.1.1:
├── launch.sh
├── lib
│ ├── com.bea.core.utils.full_2.0.0.0.jar
│ ├── com.bea.core.xml.xmlbeans_2.2.0.0.jar
│ ├── com.oracle.cie.comdev_6.4.0.0.jar
│ ├── com.oracle.cie.config_7.2.0.0.jar
│ ├── com.oracle.cie.config-wls_7.2.0.0.jar
│ ├── com.oracle.cie.config-wls-schema_10.3.6.0.jar
│ ├── com.oracle.cie.wizard_6.1.0.0.jar
│ ├── com.oracle.core.weblogic.msgcat_1.3.0.0.jar
│ ├── jython.jar
│ ├── weblogic.jar
│ ├── weblogic.server.modules.jsf2.0_12.1.1.0.jar
│ ├── wlclient.jar
│ ├── wlfullclient.jar
│ └── wlthint3client.jar
└── props.txt
Oracle 论坛上描述的props.txt 为空,而launch.sh 包含:
props.txt is empty described on the Oracle forum and launch.sh contains:
java -cp $(echo lib/*.jar | tr ' ' ':') -Dprod.props.file=props.txt -Dbea.home= -Dweblogic.home= weblogic.WLST
在运行launch.sh时,出现错误:
on running launch.sh, i get the error:
sam@ubuntu64vm:~/Desktop/scripts$ ./launch.sh
Initializing WebLogic Scripting Tool (WLST) ...
Problem invoking WLST - java.lang.NullPointerException
是否可以创建一个最小/可移植的 WLST 应用程序?
Is it possible to create a minimal / portable WLST application?
推荐答案
通过运行以下命令,独立 WSLT 适用于 Weblogic 10.3.4(请参阅注释 3,这停止了 java.lang.NullPointerException):
Standalone WSLT works for Weblogic 10.3.4 by running the following command (see Note 3, this stopped the java.lang.NullPointerException):
java -cp lib/wlfullclient.jar;lib/com.bea.core.xml.xmlbeans_2.2.0.0.jar;lib/com.oracle.cie.comdev_6.3.0.0.jar;lib/com.oracle.cie.config-wls-schema_10.3.4.0.jar;lib/com.oracle.cie.config-wls_7.1.0.0.jar;lib/com.oracle.cie.config_7.1.0.0.jar;lib/com.oracle.cie.wizard_6.1.0.0.jar;lib/com.oracle.core.weblogic.msgcat_1.1.0.0.jar;lib/jython.jar;lib/weblogic.jar -Dprod.props.file=lib/props.txt -Dbea.home= -Dweblogic.home=c:/users/username/wls10 weblogic.WLST your-script.py
脚本注意事项:
- 我的 WLST 示例设置从 c:/users/username/wls10 运行
- 所需的 jar 位于 c:/users/username/wls10/lib.
- weblogic.home 必须设置为绝对路径,例如c:/users/username/wls10'.
- 您必须在 /lib 目录中创建一个空白的 props.txt.
- 我还遵循了上述相同的说明.
- My Example setup of WLST is run from c:/users/username/wls10
- The required jar are in c:/users/username/wls10/lib.
- The weblogic.home must be set to an absolute path e.g. c:/users/username/wls10'.
- You must create a blank props.txt in /lib directory.
- I also followed same instructions as above.
这篇关于如何创建可移植的 Weblogic 脚本工具应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!