Friday, March 21

How to Debug WebLogic Server (WLS) Life Cycle Problems?



The WebLogic Server (WLS) lifecycle is characterized by the states in which a server exists and the events which cause states to change. Problems with components can prevent state changes. The tracing and debug options described in this document can be used the following instances, or similar situations:
. Server startup failure - on initial startup or from STANDBY on cluster failover
. Shutdown hanging
. Failure of Resume from the server ADMIN mode

1) Debug Settings:

Enable debug options to provide more information regarding failures of the server to change states.

First the Log Level should be set to Debug on all Servers. This can be done via the Administration Console or through the command line before the servers start up (use the JVM startup argument -Dweblogic.StdoutSeverityLevel).

In the Console the log severity level is available in the advanced logging panel of each server.
. -Dweblogic.slc=true
Use this flag to enable debug level traces that show status for lower-level WLS services, including starting and stopping the domainRuntimeServerService.
. -Dweblogic.debug.DebugServerLifeCycle=true
Use this flag to enable debug level traces for Server Life Cycle. Set the trace flags as shown in this example taken from the managed server startup log startManagedWebLogic.sh:

JAVA_OPTIONS="-Dweblogic.security.SSL.trustedCAKeyStore="/refresh/Middleware/wlserver_10.3/server/lib/cacerts" ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.debug.DebugServerLifeCycle=true ${JAVA_OPTIONS}"

Log files will be found in %DOMAIN_HOME%\servers\%SERVER_NAME%\logs\%SERVER_NAME%.log; the actual path names depend on the names used during the initial domain and server configuration. Look for the Debug messages associated with ServerLifeCycle.

2) Remote Debugging

If necessary, the server can be started with remote debugging enabled: for example, this is needed to use the Eclipse debugger. Add the following under JAVA_OPTIONS in the script used to start the server:
JAVA_OPTIONS=$JAVA_OPTIONS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

1 comment: