Hbase actual WEB project close abnormality and solution

The main content of the exception has two points (see the end of the article for complete exception information): ◾Memory
problem

thread named [main-SendThread(hadoop1:2181)] but has failed to stop it. This is very likely to create a memory leak.
◾ Loading issue

java.lang.NoClassDefFoundError: org/apache/hadoop/util/ShutdownHookManager$2.


Exception Cause Analysis

According to the JDK documentation, there are the following contents:

Terminate the currently running Java virtual machine by starting the shutdown sequence of the virtual machine. This method never returns normally. A variable can be used as a status code; by convention, a non-zero status code indicates abnormal termination.

The shutdown sequence of a virtual machine consists of two phases. In the first phase, all registered shutdown hooks (if any) are started in some unspecified order, and they are allowed to run concurrently to completion. In the second phase, if exit finalization is enabled, run all uncalled finalizers. Once this phase is complete, the virtual machine is paused.

If this method is called after the virtual machine has started its shutdown sequence, this method will block indefinitely if the shutdown hook is running. If the shutdown hook has finished running, and on-exit finalization is enabled, then this method will suspend the virtual machine with the given status code (if the status code is non-zero); otherwise it will block the virtual machine indefinitely.

The point is this: if this method is called after the virtual machine has started its shutdown sequence, this method will block indefinitely if the shutdown hook is running. From the jstack, you can also see that the threads Thread-74 and Thread-87 of the shutdownHook are in the BLOCKED state.



Reference article:

http://www.tuicool.com/articles/jUV73yz

http://stackoverflow.com/questions/19388201/could-not-load-org-apache-hadoop-util-shutdownhookmanager-when-shutdown-tomcat- s



Tentative solution

Call when Java Web is closed: System.exit(0);

This method can initially solve the above abnormal problem, and further verification is required. If it is not enough, please criticize and correct.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326933770&siteId=291194637