1
回答
intellij idea中如何配置tomcat+SSL

我在tomcat中已经配置了ssl访问(server.xml,证书都已经ok),直接用tomcat的startup.bat启动没有问题。然后在自己的web项目中配置了web.xml:

<security-constraint>
        <web-resource-collection>
            <web-resource-name>localhost</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>


        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

重新在intellij中启动tomcat调试,网页报错:ERR_CONNECTION_REFUSED。

日志如下:

六月 30, 2015 3:04:22 下午 org.apache.catalina.startup.Catalina stopServer
严重: Could not contact localhost:8005. Tomcat may not be running.
六月 30, 2015 3:04:22 下午 org.apache.catalina.startup.Catalina stopServer
严重: Catalina.stop: 
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)

大家帮忙看看是什么问题,或者应该怎么配置

举报
木易火山
发帖于3年前 1回/2K+阅
顶部