Tomcat deploys the APR based Apache Tomcat native...

Source: Internet
Author: User
Tags sendfile apache tomcat

When Tomcat is started, org. Apache. Catalina. Core. aprlifecyclelistener is displayed...

Apachetomcatjavajniie
Many articles are provided on the Internet to address this problem, but most of them differ from the situations I encountered, So I recorded them here.

Tomcat needs to be used in recent development. You can find a newer version 6.0.20 at will. Prompt when startup is found:
"18:06:06 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: The APR based Apache Tomcat native library which allows optimal performance in production environments was not found on the java. Library. Path :...", The printed path includes % java_home %/bin, % SystemRoot %/system32 (WindowsXP), and the path value of the system variable.

In http://tomcat.apache.org/tomcat-6.0-doc/apr.html, you can see the Introduction to apr:
"

Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. The Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2.x. APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets). These features allows making Tomcat a general purpose webserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver platform rather than simply a backend focused technology.

"
In addition, the installation requires the support of the following components:

* APR library * JNI wrappers for APR used by Tomcat (libtcnative) * OpenSSL libraries

The following solutions are provided in the search results:
"To begin ",
So simple? Okay. I came to http://tomcat.heanet.ie/native/and found that the latest version is 1.1.14, while readmeindicates that the stable version is 1.1.12. Download completed, copy to system32, restart tomcat, and report the following error:
"
2010-5-12 17:55:42 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: loaded APR based Apache Tomcat native library 1.1.12.
2010-5-12 17:55:42 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: Apr capabilities: ipv6 [True], sendfile [True], accept filters [false], random [True].
17:55:43 org. Apache. Coyote. http11.http11aprprotocol init
Severe: Error initializing endpoint
Org. Apache. tomcat. JNI. Error :?????????? ?? Why? Parameters ?????????
At org. Apache. tomcat. JNI. Socket. Create (native method)
At org.apache.tomcat.util.net. aprendpoint. INIT (aprendpoint. Java: 612)
At org. Apache. Coyote. http11.http11aprprotocol. INIT (http11aprprotocol. Java: 107)
At org. Apache. Catalina. connector. connector. initialize (connector. Java: 1058)
At org. Apache. Catalina. Core. standardservice. initialize (standardservice. Java: 677)
At org. Apache. Catalina. Core. standardserver. initialize (standardserver. Java: 795)
At org. Apache. Catalina. startup. Catalina. Load (Catalina. Java: 535)
At org. Apache. Catalina. startup. Catalina. Load (Catalina. Java: 555)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 585)
At org. Apache. Catalina. startup. Bootstrap. Load (Bootstrap. Java: 260)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 412)
...
"
I am not sure what benefits this APR can bring to me, but I can be sure that the conditions required for installation are met, therefore, the copy path is incorrect. However, the same error is still reported under % java_home %/bin. Where should I copy it? My colleague suggested that I copy it to % catalina_home %/bin, which reminds me. Copy and restart. An error is still reported...

It seems it should be the problem with the tcnative-1.dll version. To the Apache Tomcat site to download the two latest versions: 5.5.29, 6.0.26, Unzip a look, the problem is clear: the latest version of the tcnative-1.dll is 1.1.20, the location in the/bin directory, I copied it to the/bin of tomcat6.0.20 and restarted. Normal:
"18:47:45 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: loaded APR based Apache Tomcat native library 1.1.20.
2010-5-12 18:47:45 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: Apr capabilities: ipv6 [True], sendfile [True], accept filters [false], random [True].
18:47:45 org. Apache. Coyote. http11.http11aprprotocol init
Information: initializing coyote HTTP/1.1 on http-9000
18:47:45 org. Apache. Coyote. AJP. ajpaprprotocol init
Information: initializing coyote AJP/1.3 on ajp-8009
2010-5-12 18:47:45 org. Apache. Catalina. startup. Catalina Load
Information: initialization processed in 862 MS
2010-5-12 18:47:45 org. Apache. Catalina. Core. standardservice start
Information: starting service Catalina
2010-5-12 18:47:45 org. Apache. Catalina. Core. standardengine start
Information: Starting Servlet Engine: Apache Tomcat/6.0.20
18:48:06 org. Apache. Coyote. http11.http11aprprotocol start
Information: Starting coyote HTTP/1.1 on http-9000
2010-5-12 18:48:06 org. Apache. Coyote. AJP. ajpaprprotocol start
Information: Starting coyote AJP/1.3 on ajp-8009
2010-5-12 18:48:06 org. Apache. Catalina. startup. Catalina start
Information: server startup in 20997 MS
18:48:59 org. Apache. Coyote. http11.http11aprprotocol pause
Information: pausing coyote HTTP/1.1 on http-9000
18:48:59 org. Apache. Coyote. AJP. ajpaprprotocol Paus
"
At this point, this problem has come to an end, probably because I took a tomcat at will and used it, that is to say, the distribution used "not include the Windows Service wrapper nor the compiled APR/native library for Windows ".
As for the latest tcnative-1.dll and tomcat native related resources, you can access ingress.

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.