最近我下载了JDK 11.0.2&tomcat 9.0.16并设置环境变量,但是每当我启动tomcat时,它都会在控制台和http://localhost:8080/无法访问中显示以下例外。请帮助。
06-Mar-2019 03:34:43.186 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-8080]] 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:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:535)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1055)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.startup.Catalina.load(Catalina.java:589)
at org.apache.catalina.startup.Catalina.load(Catalina.java:612)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.io.IOException: Unable to establish loopback connection
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:94)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:61)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:171)
at java.base/sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
at java.base/java.nio.channels.Pipe.open(Pipe.java:155)
at java.base/sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:127)
at java.base/sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
at java.base/java.nio.channels.Selector.open(Selector.java:295)
at org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector(NioSelectorPool.java:54)
at org.apache.tomcat.util.net.NioSelectorPool.close(NioSelectorPool.java:109)
at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:338)
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1090)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1098)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:557)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
... 13 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:482)
at java.base/sun.nio.ch.Net.connect(Net.java:474)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:694)
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194)
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:127)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:76)
... 29 more
我还尝试了不同的连接器端口,但没有起作用,但是当我在另一台计算机中使用相同配置的同一件事毫无例外地使用,并且可以访问Localhost。我的机器有任何问题吗?
这个错误意味着您的端口忙
。
- 停止tomcat
- 更改端口号
- 重新启动您的应用
在此处阅读有关错误的更多信息