5

I'm using WebLogic Server version 10.3.6.0 and have been tasked with writing some scripts to automatically deploy Java applications.

I'm looking at the documentation for weblogic.Deployer but when I try and run it, I get the following error:

Error: Could not find or load main class weblogic.Deployer

I have run the setWLSEnv.sh script in server/bin of the Server's installation directory, which sets PATH and CLASSPATH environment variables. My understanding was that weblogic.Deployer was part of server/lib/weblogic.jar, and that is being set in the script as part of the CLASSPATH variable.

How could I find out where the weblogic.Deployer class is located?

Thanks in advance for any assistance.

4

3 回答 3

9

$CLASSPATH 是您的 weblogic.jar 所在的位置:

~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

(用你的机器路径替换~)

所以整个代码将是这样的:

>java -cp ~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer -adminurl ...

或者,在ENVIRONMENT参数中添加~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar您的CLASSPATH变量。如果它不存在,请创建一个。然后只需执行命令:

>java weblogic.jar weblogic.Deployer -adminurl ...

通过将其永久添加到 CLASSPATH 中,我们可以使用命令的帮助选项,如下所示:

>>java weblogic.Deployer -help
于 2016-03-16T13:41:48.857 回答
4

明白了——只需要在执行脚本时指定类路径变量:

java -cp $CLASSPATH weblogic.Deployer
于 2013-10-21T00:37:11.853 回答
0

添加完整命令

D:>java -cp **D:\programFiles\WebLogic\install\wlserver\server\lib\weblogic.jar** weblogic.Deployer -adminurl **t3://localhost:7001** -username **weblogic** -password **password123** -deploy -name **application-ws-1.0.0-SNAPSHOT** -targets AdminServer -source **D:\Users\tom\application-ws\target\application-ws-1.0.0-SNAPSHOT.war**
于 2021-10-27T16:23:49.693 回答