Tomcat start error resolution on CentOS 6.5 _linux

Source: Internet
Author: User
Tags openssl openssl library openssl version tomcat apache tomcat

Here are two errors:

1, the first error, Apr problem, error details:

The APR based Apache Tomcat Native Library which allows optimal performance in production environments is not found on th E Java.library.path

2, the second error, error details:

Exception in thread "main" Java.lang.InternalError
At (Native method)
At$000 (
At$ (

the first solution to the problem:

This is a problem with APR, because Tomcat needs to rely on APR to optimize performance, and you need to install APR

1, the first installation of APR, using the source code installation, the default installation in:/USR/LOCAL/APR

Copy Code code as follows:

TAR-ZXVF apr-1.5.0.tar.gz
CD apr-1.5.0
Make install

2, the next installation tomcat-native, this GZ packet in Tomcat bin directory already exist, directly decompression tomcat-native;

Enter directory: CD tomcat-native-1.2.7-src/native, then compile the installation:

./configure--with-apr=/usr/local/apr--with-java-home= "/usr/lib/jvm/java-1.7.0"--with-ssl=yes

If the downloaded Tomcat version is newer, the OpenSSL version of the build installation appears to be inconsistent and cannot be installed with the following error:

Checking OpenSSL library version >= 1.0.2 ... Configure:error:Your version of OpenSSL is not compatible and this version of Tcnative

You need to download a lower version of the Tomcat-native package:


After downloading the above GZ package, put it down to Tomcat's Bin directory, unzip it, enter the directory: CD tomcat-native-1.1.20-src/jni/native, then compile the installation

3, after the successful compilation installation, in Tomcat's Bin directory, a new file named

Add content in new file:

Ld_library_path= $LD _library_path: $CATALINA _home/lib
Export Ld_library_path
4, after the above three steps, the first question can be resolved;

The second problem-solving method:

This is due to the JDK version of the problem, I installed the OPENJDK, there will be a loss of jar package, causing the error to start, so there is a need to replace the JDK for Oracle

1, to the official Oracle download a package such as: jdk-7u79-linux-x64.tar.gz

2, after decompression, moved to the/usr/local/java directory

3, ADD environment variable: vim/etc/profile, the file finally add the following lines

Copy Code code as follows:

Export java_home=/usr/local/java/jdk1.7.0_79//actual JDK path
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin

4, the completion of the above installation, and then start Tomcat, found also will be an error: Neither the Java_home nor the JRE_HOME environment variable is defined

The problem is that Tomcat doesn't recognize the JDK's environment variables.

5, modify the Bin directory in Tomcat file, at the beginning of the file, add the following code:

Copy Code code as follows:

Export java_home=/usr/local/java/jdk1.7.0_79////The actual JDK path

Finally start Tomcat, log print normal, browser can also access, problem resolution

Exception in thread main ' Java.lang.InternalError
        at (Native)
        at$000 (
        at$ (

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: 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.