Love to code, although it bugs me.

Weblogic Server Unexpectedly Shuts Down

2 comments
stopRunning an Oracle SOA Weblogic deployment on a development Linux server, our team was confronted with an unexpected forced shutdown problem with no apparent trigger. At first, I even thought it could be one of the developers that got access to the machine and was shutting it down for some reason. After a quick look at the command and log history, it was evident that it was an automatic behavior of some sort. And it was triggered by the logoff or session timeout of the remote shell used to issue the command to start the server.
Doing some research on the Web I got to this official Oracle documentation where it’s stated that the JVM listens to the following inputs from the host operating system:
  • CTRL_C_EVENT
  • CTRL_CLOSE_EVENT
  • CTRL_LOGOFF_EVENT
  • CTRL_SHUTDOWN_EVENT
In J2SE 1.3.0, the Shutdown Hooks facility was added to allow orderly shutdown of a Java application. The intent was to allow user cleanup code (such as closing database connections) to run at shutdown, even if the JVM terminates abruptly. More important to our subject at hand, the JVM watches for console control events to implement shutdown hooks for abnormal JVM termination.
The solution to prevent the Weblogic server from shutting down is to reduce the use of operating system signals by the JVM. This is done by adding the “-Xrs” option to the JAVA_OPTIONS variable on your script to start the Weblogic server.
In our case, using Weblogic 10.3 on a RHEL server, we modified the domain script “startWebLogic.sh” to include the “-Xrs” option:
JAVA_OPTIONS = “${JAVA_OPTIONS} –Xrs”
Afterwards, we stopped the Weblogic domain, restarted it and it stopped forcing the shutdown, even after the user logoff.

2 comments :

  1. A better way is to use nohup and keep the signals so you can do things like kill -3 to generate thread dumps.

    ReplyDelete
    Replies
    1. Thanks for the thoughtful input John. You are absolutely right. The only value added of the solution I suggest is that it suits both linux and windows.

      Delete