Idea 12 Tomcat 7 and SSL

I have a app that has ssl enabled, when I run that app from tomcat alone everything is fine but when I run it from Idea it says that port 443 is already bound.  I'll post the server.xml and logs below, any ideas?

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
    <!--APR library loader. Documentation at /docs/apr.html -->
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>
    <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
    <Listener className="org.apache.catalina.core.JasperListener"/>
    <!-- Prevent memory leaks due to use of particular java/javax APIs-->
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

    <GlobalNamingResources>
        <Resource name="UserDatabase" auth="Container"
                  type="org.apache.catalina.UserDatabase"
                  description="User database that can be updated and saved"
                  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                  pathname="conf/tomcat-users.xml"/>
    </GlobalNamingResources>

    <Service name="Catalina">

        <Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="443"/>

        <Connector SSLEnabled="true" acceptorThreadCount="5" clientAuth="want"
                   keystoreFile="conf/xxxxx.p12" keystorePass="xxxxxxx"
                   keystoreType="PKCS12" keyAlias="xxxxx" maxConnections="-1" maxThreads="150" port="443"
                   protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sessionTimeout="0"
                   socket.soKeepAlive="true" sslProtocol="TLSv1" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA"
                   xxxxSecureConnector="true" dbDriverClassName="org.hsqldb.jdbcDriver"
                   dbUrl="jdbc:hsqldb:file:C:\Users\TWynne\linkosDB" dbUsername="xxxx" dbPassword="xxxxx"
                   compression="on" compressionMinSize="10"
                   compressableMimeType="text/html,text/xml,text/javascript,text/css,application/javascript"/>


        <!-- Define an AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>


        <Engine name="Catalina" defaultHost="localhost">

            <Realm className="org.apache.catalina.realm.LockOutRealm">
                <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                       resourceName="UserDatabase"/>
            </Realm>

            <Host name="localhost" appBase="webapps"
                  unpackWARs="true" autoDeploy="true">

                <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                       prefix="localhost_access_log." suffix=".txt"
                       pattern="%h %l %u %t &quot;%r&quot; %s %b"/>

            </Host>
        </Engine>
    </Service>
</Server>


console log is:

C:\java\apache-tomcat-7.0.42\bin\catalina.bat run
[2013-10-17 03:57:52,910] Artifact Tiger: Server is not connected. Deploy is not available.
[2013-10-17 03:57:52,910] Artifact Lion: Server is not connected. Deploy is not available.
Using CATALINA_BASE:   "C:\Users\TWynne\.IntelliJIdea12\system\tomcat\Unnamed_Profile_Manager"
Using CATALINA_HOME:   "C:\java\apache-tomcat-7.0.42"
Using CATALINA_TMPDIR: "C:\java\apache-tomcat-7.0.42\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.6.0_43"
Using CLASSPATH:       "C:\java\apache-tomcat-7.0.42\bin\bootstrap.jar;C:\java\apache-tomcat-7.0.42\bin\tomcat-juli.jar"
Oct 17, 2013 3:57:53 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
Oct 17, 2013 3:57:53 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Oct 17, 2013 3:57:53 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'zebraSecureConnector' to 'true' did not find a matching property.
Oct 17, 2013 3:57:53 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'dbDriverClassName' to 'org.hsqldb.jdbcDriver' did not find a matching property.
Oct 17, 2013 3:57:53 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'dbUrl' to 'jdbc:hsqldb:file:C:\Users\TWynne\linkosDB' did not find a matching property.
Oct 17, 2013 3:57:53 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'dbUsername' to 'admin' did not find a matching property.
Oct 17, 2013 3:57:53 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'dbPassword' to 'admin' did not find a matching property.
Oct 17, 2013 3:57:54 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-443"]
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-nio-443"]
java.net.BindException: Address already in use: bind
 at sun.nio.ch.Net.bind(Native Method)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:124)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
 at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:473)
 at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
 at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
 at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
 at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
 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:597)
 at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Oct 17, 2013 3:57:54 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[org.apache.coyote.http11.Http11NioProtocol-443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[org.apache.coyote.http11.Http11NioProtocol-443]]
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
 at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
 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:597)
 at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
 at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
 ... 12 more
Caused by: java.net.BindException: Address already in use: bind
 at sun.nio.ch.Net.bind(Native Method)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:124)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
 at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:473)
 at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)
 at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)
 at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
 at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
 ... 13 more
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Oct 17, 2013 3:57:54 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1016 ms
Oct 17, 2013 3:57:54 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 17, 2013 3:57:54 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Oct 17, 2013 3:57:54 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Oct 17, 2013 3:57:54 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 37 ms
Connected to server

2 comments

Just wanted to add that this is Idea 12.1.6.

Also, I'm deploying 2 wars, could it be possible that each application war is trying to get that port and if so, is there a way in Idea to tell them to share it?  I'm under the impression that if it's defined in the server.xml file and placed in the /tomcat/conf directory that the wars would share it.

0

Disreguard this, turned out that 443 was taken by a previous instance of my app running through intellij.  Very weird, after basically rebooting the machine it all works now so I'll pay more attention to how the app is shutting down.

0

Please sign in to leave a comment.