Friday, January 6, 2012

Weblogic auto login with boot properties file

Weblogic requires JVM property -Dweblogic.system.BootIdentityFile to locate file
How a Server Uses a Boot Identity File at Startup

# create boot properties file

#use from AdminServer dir - this is necessary for weblogic.Admin to run without password
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${DOMAIN_HOME}/servers/${SERVER_NAME}/security/"

# add trust key store

# check if admin server is not already running
echo "Checking if admin server is not already running..."
${JAVA_HOME}/bin/java ${SSL_ARGS} weblogic.Admin -url t3s://localhost:7001 PING

Without JVM property attempt to call Weblogic without password returns following error

WebLogic server requires a valid username and password for the command that you are trying to execute. Please try again

Password and username can be encrypted by which is using domain key /app/domains/base_domain/security/SerializedSystemIni.dat



. $WL_HOME/server/bin/



printf "username=" > $BOOT_PROPERTIES_FILE
java -Dweblogic.RootDirectory=/app/domains/base_domain weblogic >> $BOOT_PROPERTIES_FILE
printf "password=" >> $BOOT_PROPERTIES_FILE
java -Dweblogic.RootDirectory=/app/domains/base_domain weblogic123 >> $BOOT_PROPERTIES_FILE

[dave@dave java]$ more /app/domains/base_domain/servers/AdminServer/security/ 

Domain Configuration Files
This directory holds security-related files that can be or must be different for each Oracle WebLogic Server instance. The file is an example of a file that resides here because it can differ from one server to the next. This directory also maintains files related to SSL keys.