"Info:deploying Web application directory ..." solution for Tomcat boot time

Source: Internet
Author: User

Reprint Address: http://blog.csdn.net/njchenyi/article/details/46641141

The first time you encounter Tomcat booting from a Linux server, the situation is simple, and after Tomcat boots it is stuck in info:deploying Web application directory ... This sentence, how long the specific card will not be tested. Google, Baidu have not found a solution.

Fortunately, Ucloud's technical support staff gave the solution.

Locate the Jdk1.x.x_xx/jre/lib/security/java.security file, find the Securerandom.source setting in the file, and change it to:

Securerandom.source=file:/dev/./urandom

At this time, according to the changes can be found because this causes not only Tomcat, but also caused the WebLogic start slow,

Linux or some UNIX systems provide random numbers of devices that are/dev/random and/dev/urandom, two have a difference, urandom security is not random high, but random takes time interval to generate a stochastic number. The JDK calls random by default.
Then, finally, in WebLogic's official document monitoring and troubleshooting found avoiding JVM delays caused by Random number Generation such a title. Excerpts are as follows:
The library used for random number generation in Sun's JVM relies on/dev/random by default for UNIX platforms. This can potentially block the Oracle WebLogic communication Services process because on some operating Systems/dev/rando M waits for a certain amount of "noise" to is generated on the host machine before returning a result. Although/dev/random is more secure, Oracle recommends Using/dev/urandom if the default JVM configuration delays Oracle W Eblogic Communication Services startup.
To determine if your operating system exhibits this behavior, try displaying a portion of the file from a shell prompt:
Head-n 1/dev/random
Open the $JAVA _home/jre/lib/security/java.security file in a text editor.
Change the line:
Securerandom.source=file:/dev/random
To read:
Securerandom.source=file:/dev/urandom
Save your change and exit the text editor.
It says: You can head-n 1/devrandom to see if your system will appear pseudo-random number to provide the wait. OK on this, try it, sure enough, after the first boot of the server, this can provide a value quickly, but wait when the call occurs again.
Workaround:
Permanent: Oracle says to modify $JAVA _home/jre/lib/security/java.security file, replacing Securerandom.source=file:/dev/random as Securerandom.source=file:/dev/urandom. Takes effect for all applications that use the JVM. (This permanent method, there is a problem, it is set when the actual should be set toSecurerandom.source=file:/dev/./urandom, otherwise does not take effect)
Domain Temp: Modify the startweblogic.sh file, java_options= "${save_java_options}-djava.security.egd=file:/dev/./urandom"
Subsequent SecureRandom test learning
Write Java class as below, run the test, the first normal, the second wait, restart the server after the first time and normal. Start join parameter-djava.security.egd=file:/dev/./urandom Normal

"Info:deploying Web application directory ..." solution for Tomcat boot time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.