3
votes

Deploy weblogic using jenkins without jenkins plugin.

jenkins weblogic plugin use this command. So I try use it.

/bin/java -Xms256M -Xmx256M -cp /root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets AdminServer -adminurl t3://127.0.0.1:7001 -user {ID} -password {password} -deploy

But If I use this command not use plugin but only raw command, there is error.

error: Cannot find basic class weblogic.Deployer or cannot load weblogic.Deployer.

above error evoke as korean language, so I translated to english. under error is jenkins error part.

[WeblogicDeploymentPlugin] - ARTIFACT UNDEPLOYED SUCCESSFULLY. [WeblogicDeploymentPlugin] - DEPLOYING ARTIFACT... $ /bin/java -Xms256M -Xmx256M -cp /root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets AdminServer -adminurl t3://127.0.0.1:7001 -user {id} -password {passwd} -deploy [WeblogicDeploymentPlugin] - ARTIFACT DEPLOYED SUCCESSFULLY. [INFO] [INFO] DEPLOYMENT SUCCESS [INFO]

SSH: Connecting from host [localhost.localdomain]

SSH: Connecting with configuration [weblogic] ...

SSH: EXEC: STDOUT/STDERR from command[ /bin/java -Xms256M -Xmx256M -cp /root/wls12210/wlserver/server/lib/weblogic.jar weblogic.Deployer -debug -stage -remote -verbose -upload -name testPage -source /root/.jenkins/workspace/WebLogic/target/testPage.war -targets AdminServer -adminurl t3://127.0.0.1:7001 -user {id} -password {passwd} -deploy

error: Cannot find basic class weblogic.Deployer or cannot load weblogic.Deployer.

How can I solve this error?

2

2 Answers

1
votes

Have you tried building wlfullclient.jar and putting that on your classpath instead? weblogic.jar doesn't have any of the ancillary libraries that you'll probably need.

1
votes

Better load the weblogic environment first, it will load all the weblogic related classes you may need:

According to the path you showed, run this in command line before you try to start the java virtual machine:

". /root/wls12210/wlserver/server/bin/setWLSEnv.sh"