Bug 43800 - Severe error with native dll and SSL
Severe error with native dll and SSL
Status: RESOLVED FIXED
Product: Tomcat Native
Classification: Unclassified
Component: Library
unspecified
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-11-06 15:09 UTC by Larry Singer
Modified: 2014-02-17 13:50 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Singer 2007-11-06 15:09:16 UTC
I have configuration where where Tomcat loads the SSL connector correctly when
the native library is not installed, but has an error when the native library is
added to the classpath.

Configuration is a fresh install with this added to server.xml:
	<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="10" scheme="https" secure="true"
               clientAuth="true" sslProtocol="TLS"
               keystoreFile="C:\SmartHealth\SmartdevelopmentSSLStore"
               keystorePass="W0Lv3r1n3"
               truststoreFile="C:\SmartHealth\truststore"
               truststorePass="changeit"/>

Error is:

7/11/2007 10:07:07 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native library 1.1.10.
7/11/2007 10:07:07 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false],
random [true].
7/11/2007 10:07:08 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
7/11/2007 10:07:08 org.apache.coyote.http11.Http11AprProtocol init
SEVERE: Error initializing endpoint
java.lang.Exception: No Certificate file specified
	at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)
	at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:684)
	at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:121)
	at org.apache.catalina.connector.Connector.initialize(Connector.java:1059)
	at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
	at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:792)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:518)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
	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)
7/11/2007 10:07:08 org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed:
java.lang.Exception: No Certificate file specified
	at org.apache.catalina.connector.Connector.initialize(Connector.java:1061)
	at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
	at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:792)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:518)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
	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)
7/11/2007 10:07:08 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1864 ms
7/11/2007 10:07:08 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
7/11/2007 10:07:08 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
7/11/2007 10:07:10 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
7/11/2007 10:07:10 org.apache.coyote.http11.Http11AprProtocol start
SEVERE: Error starting endpoint
java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket
address (protocol/network address/port) is normally permitted.  
	at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:612)
	at org.apache.tomcat.util.net.AprEndpoint.start(AprEndpoint.java:717)
	at org.apache.coyote.http11.Http11AprProtocol.start(Http11AprProtocol.java:151)
	at org.apache.catalina.connector.Connector.start(Connector.java:1132)
	at org.apache.catalina.core.StandardService.start(StandardService.java:531)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	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.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
7/11/2007 10:07:10 org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start: 
LifecycleException:  service.getName(): "Catalina";  Protocol handler start
failed: java.lang.Exception: Socket bind failed: [730048] Only one usage of each
socket address (protocol/network address/port) is normally permitted.  
	at org.apache.catalina.connector.Connector.start(Connector.java:1139)
	at org.apache.catalina.core.StandardService.start(StandardService.java:531)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	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.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
7/11/2007 10:07:10 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2449 ms
Comment 1 Markus Schönhaber 2007-11-06 15:25:27 UTC
The configuration for an HTTPS Connector when using APR is different from the
configuration when APR is not used. This is explained in the docs for APR.
If something remains unclear after reading the docs, post your question to the
Tomcat Users mailing list.
Comment 2 Larry Singer 2007-11-18 15:07:35 UTC
This error message does not make it easy to find what caused the error. 

The message does not mention APR. The Tomcat installation talks about native,
not APR. There is no obvious connection between these two terms. I suggest this
message is changed:
7/11/2007 10:07:07 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native library 1.1.10.
to:
7/11/2007 10:07:07 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native (APR) library 1.1.10.

I suggest the message at the top of the page
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html also includes the words
"Apache Tomcat Native library".

Also, the error message says the file is not specified. I suggest this message
be revised to say "no file specified or in an invalid format".
Comment 3 Mark Thomas 2008-01-01 09:34:33 UTC
Thanks for the comments. I have updated the docs, the installer and the error
messages. Generally I have replaced APR and Native with "APR based Apache Tomcat
Native library" or similar.

These changes have been made in svn and proposed for 6.0.x
Comment 4 Mark Thomas 2008-01-10 13:28:48 UTC
This has been fixed in svn and will be included in 6.0.16 onwards.