啟動Tomcat時,若在視窗中出現,下列訊息時的解決方法......
[java] 資訊: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
此問題原因是Tomcat中沒有安裝Tomcat Native元件,
其說明文件提供的用途說明如下:
Apache Tomcat Native Library
What is it?
-----------
The Apache Tomcat Native Library provides portable API for features
not found in contemporary JDK's. It uses Apache Portable Runtime as
operating system abstraction layer and OpenSSL for SSL networking and
allows optimal performance in production environments.
解決方法:
請至Tomcat網站http://tomcat.apache.org/download-native.cgi,下載合適版本的Tomcat Native檔案,
下載的檔案包含有win32、i64、x64版本的tcnative-1.dll,
請選擇符合您Tomcat版本的tcnative-1.dll置入Tomcat安裝路徑CATALINA_HOME/bin中,即可解決問題。
假設Tomcaatt版本為32位元版本,卻置入x64版本的tcnative-1.dll,
錯誤訊息將如下所示:
[java] java.lang.UnsatisfiedLinkError: C:\apache-tomcat-7.0.42\bin\tcnative-1.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
[java] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[java] at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
[java] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
[java] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872)
[java] at java.lang.Runtime.loadLibrary0(Runtime.java:849)
[java] at java.lang.System.loadLibrary(System.java:1087)
[java] at org.apache.tomcat.jni.Library.<init>(Library.java:42)
[java] at org.apache.tomcat.jni.Library.initialize(Library.java:174)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:180)
[java] at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:85)
[java] at org.apache.catalina.connector.Connector.setProtocol(Connector.java:595)
[java] at org.apache.catalina.connector.Connector.<init>(Connector.java:69)
[java] at org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:62)
[java] at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
[java] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:506)
[java] at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1303)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
[java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
[java] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
[java] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
[java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
[java] at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:617)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
留言列表