I'm trying to perform remote uploading and deploying via WLST. I succeed to deploy applications already present in the path of the WebLogic server. But now, I would like to deploy one remotely available.
Is there any possibility to upload WAR/EAR on the WebLogic server via WLST before deploying it?
I'm running weblogic 12C.
I tried with:
java -cp wlserver/server/lib/weblogic.jar weblogic.Deployer -adminurl t3://WeblogicServer:7001 -user weblogic -password weblogic -deploy /tmp/HelloWorld.war -remote -upload
give me as return:
weblogic.Deployer invoked with options: -adminurl t3://WeblogicServer:7001 -user weblogic -deploy /tmp/HelloWorld.war -remote -upload
<6 juil. 2012 17 h 58 CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, HelloWorld [archive: /tmp/HelloWorld.war], to configured targets.>
[J2EE Deployment SPI:260080]Unable to define the application install directory at "/tmp/helloworld.war". Directory could not be created or is a file.
And when i check on the server, nothing is deployed.
Yes, there is. Take a look at WLST
deploy
command reference (This link is for version 10gR3).You can specify the
remote
and theupload
options withtrue
, since their default values are false.PS 1: The
remote
option is not available on WebLogic 9.0 and older versions (but you can always get a newerweblogic.jar
and try.PS 2: You will need to have remote access to the administrative interfaces (usually ports 7001 and/or 7002). That means opening firewalls, etc.
PS 3: Please provide the version of your WebLogic server, as this might help us help you.
I found the solution: We must not use the /tmp directory as source, because the weblogic.Deployer use this directory.
So the command is:
Written myself, can do undeploy + deploy. The deploy line is:
Complete script: (line next code out yourself, I had to add some spaces to place it here)
Have fun with it.