Thursday, May 31, 2012

WebLogic deployer: EAR deploy script for weblogic server.

#!/bin/sh

git pull

ant clean ear

WL_PATH=<wl-server>/lib/weblogic.jar
WL_URL=http://localhost:7001/

java -cp $WL_PATH:$CLASSPATH weblogic.Deployer 
     -adminurl $WL_EVR 
     -username weblogic 
     -password weblogic 
     -name my_project 
     -deploy dist/my_project.ear
Before Running this script check if tunneling is no.

Environment->servers->[server-name]->Protocols
'Enable Tunneling' flag should be ON.

WebLogic server: redirect console output to file.

Set following variable with the file path into startWebLogic.sh.
# Call setDomainEnv here.

WLS_REDIRECT_LOG=/tmp/myproject-console.log

Monday, May 28, 2012

WebLogic server Error: Could not obtain an exclusive lock for directory.

Steps to get out of this situation:

1. Shutdown the server.
2. Delete the lok file from <domain-home>/servers/<server-name>/tmp/.
3. Try to start the server.
4. If the server still fails to start then find the process which is still running on this server using following commands.
ps -ef | grep 'weblogic'
OR ps -ef | grep 'oracle'
kill -9 PID
4. Now start the server.