Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of tomcat startup error report environments was not found on the java.library.path

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about how to solve tomcat startup error report environments was not found on the java.library.path. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

The tomcat startup message appears as follows:

Information: the apr based apache tomcat native library which allows optimal performance in production environments was not found on the java.library.path:xxxx

Cause analysis:

Tomcat recommends using apache's apr to run tomcat better.

Introduction to apr of apache

The purpose of apr (apache portable run-time libraries,apache Portable Runtime Library), like its name, is to provide an underlying supporting interface library for upper-level applications that can be used across multi-operating system platforms. In early versions of apache, the application itself must be able to handle the details of a variety of specific operating system platforms and call different handlers for different platforms.

With the further development of apache, the apache organization decided to separate these common functions and develop into a new project. In this way, the development of apr is independent of apache, and apache only uses apr.

Apr moves down the processing of platform details. For applications, they do not need to consider the specific platform at all, whether it is unix, linux, or window, the interfaces executed by the applications are basically uniform. Therefore, portability and unified upper layer interface are the key points for apr to consider. This was not the original purpose of apr. At first, it just wanted to merge all the code used in apache into a common code base, but this was not the right strategy, so apr later changed its goal. Sometimes using common code is not a good thing, such as how to map a request to a thread or process is platform-related, so a common code base alone cannot make this distinction. The goal of apr is to safely merge all code that can be merged without sacrificing performance.

One of the earliest goals of apr is to provide a common unified operating function interface for all platforms (not parts), which is a great goal and, of course, an unrealistic goal. It is impossible for us to support all the features of all platforms, so apr currently only supports all apr features for most platforms, including win32, os/2, beos, darwin, linux, and so on. To achieve this goal, apr developers must create a series of feature macros (feature macros) for features that cannot run on all platforms to distinguish these features from platform to platform. These feature macros are very simple to define and are usually set with the apr_has_feature parameter:

If a platform has this feature, the macro must be set to true. For example, both linux and window have memory-mapped files, and apr provides an interface for operating memory-mapped files, so on both platforms, the apr_has_mmap macro must be set, and the ap_mmap_* function should map the disk file to memory and return the appropriate status code. If your operating system does not support memory mapping, apr_has_mmap must be set to 0, and all ap_mmap_* functions may not need to be defined. The second step is to warn those functions that are not supported in the program.

Solution 1:

Download the version of tcnative-1.dll corresponding to your tomcat, put it in the apache-tomcat-7.0.57\ bin directory, and restart tomcat.

If you don't know the version, you can download any version and put it in the directory. When you restart tomcat, you will be prompted for the appropriate tcnative-1.dll version.

1 、

two。

3.

4.

Solution 2.

This is an apr problem, because tomcat needs to rely on apr to optimize performance, so you need to install apr

1. Install apr first. Install it with source code. By default, install it at: / usr/local/apr.

Wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz

Tar-zxvf apr-1.5.0.tar.gz

Cd apr-1.5.0

. / configure

Make

Make install

2. Next, install tomcat-native. The gz package already exists in the bin directory of tomcat. Extract tomcat-native directly.

Enter the directory: cd tomcat-native-1.2.7-src/native, and then compile and install:

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

If you download a newer version of tomcat, the compilation and installation will have an inconsistent version of openssl and cannot be installed. The error is as follows:

Checking openssl library version > = 1.0.2. Configure: error: your version of openssl is not compatible with this version of tcnative

This requires downloading an earlier version of the tomcat-native package:

Wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-connectors/native/1.1.34/source/tomcat-native-1.1.34-src.tar.gz

After downloading the above gz package, put it in the bin directory of tomcat, decompress it, enter the directory: cd tomcat-native-1.1.20-src/jni/native, and then compile and install it.

3. After the compilation and installation is successful, create a new file called setenv.sh in the bin directory of tomcat

Add content to the new file:

Ld_library_path=$ld_library_path:$catalina_home/lib

Export ld_library_path

4. after the above three steps, the first question and withdrawal can be solved.

These are all the contents of the article "how to solve the problem of tomcat startup error environments was not found on the java.library.path". Thank you for your reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report