无法通过远程访问网站

来源:10-1 阿里云初始化与执行环境安装

慕虎0518913

2019-06-30

老师好,我安装完tomcat之后,尝试远程链接网站。直接报错提示超时。我尝试重启tomcat时,报错:
[root@iz8vbdkpp0o1fhakcpt0erz ~]# ./apache-tomcat-8.0.46/bin/shutdown.sh
Using CATALINA_BASE: /root/apache-tomcat-8.0.46
Using CATALINA_HOME: /root/apache-tomcat-8.0.46
Using CATALINA_TMPDIR: /root/apache-tomcat-8.0.46/temp
Using JRE_HOME: /usr
Using CLASSPATH: /root/apache-tomcat-8.0.46/bin/bootstrap.jar:/root/apache-tomcat-8.0.46/bin/tomcat-juli.jar
Jun 30, 2019 11:51:13 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jun 30, 2019 11:51:13 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
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.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:451)
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:498)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:400)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:487)
怎么才能解决?

写回答

1回答

慕虎0518913

提问者

2019-06-30

tomcat在启动时报错:

[root@iz8vbdkpp0o1fhakcpt0erz bin]# ./catalina.sh  run

Using CATALINA_BASE:   /root/apache-tomcat-8.0.46

Using CATALINA_HOME:   /root/apache-tomcat-8.0.46

Using CATALINA_TMPDIR: /root/apache-tomcat-8.0.46/temp

Using JRE_HOME:        /usr

Using CLASSPATH:       /root/apache-tomcat-8.0.46/bin/bootstrap.jar:/root/apache-tomcat-8.0.46/bin/tomcat-juli.jar

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

30-Jun-2019 18:18:22.141 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.46

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Aug 10 2017 10:10:31 UTC

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.46.0

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-514.26.2.el7.x86_64

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/java/jdk1.8.0_144/jre

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_144-b01

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /root/apache-tomcat-8.0.46

30-Jun-2019 18:18:22.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /root/apache-tomcat-8.0.46

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/root/apache-tomcat-8.0.46/conf/logging.properties

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms256m

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx512m

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xss1024K

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:PermSize=128m

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=256m

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048

30-Jun-2019 18:18:22.145 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources

30-Jun-2019 18:18:22.146 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/root/apache-tomcat-8.0.46/endorsed

30-Jun-2019 18:18:22.146 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/root/apache-tomcat-8.0.46

30-Jun-2019 18:18:22.146 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/root/apache-tomcat-8.0.46

30-Jun-2019 18:18:22.146 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/root/apache-tomcat-8.0.46/temp

30-Jun-2019 18:18:22.146 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

30-Jun-2019 18:18:22.343 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]

30-Jun-2019 18:18:22.360 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read

30-Jun-2019 18:18:22.363 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]

30-Jun-2019 18:18:22.365 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read

30-Jun-2019 18:18:22.367 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 697 ms

30-Jun-2019 18:18:22.392 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina

30-Jun-2019 18:18:22.392 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.46

30-Jun-2019 18:18:22.452 SEVERE [Catalina-startStop-1] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start

 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/upload/item]]

        at java.util.concurrent.FutureTask.report(FutureTask.java:122)

        at java.util.concurrent.FutureTask.get(FutureTask.java:192)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)

        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at java.lang.Thread.run(Thread.java:748)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/upload/item]]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        ... 6 more

Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@2c0de8f4]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4969)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 6 more

Caused by: java.lang.IllegalArgumentException: The main resource set specified [/root/apache-tomcat-8.0.46/webapps/D:/images4o2o/upload/item] is not valid

        at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:743)

        at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:701)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 9 more


30-Jun-2019 18:18:22.454 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start

 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]

        at java.util.concurrent.FutureTask.report(FutureTask.java:122)

        at java.util.concurrent.FutureTask.get(FutureTask.java:192)

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)

        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:630)

        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:498)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

        at java.lang.Thread.run(Thread.java:748)

Caused by: org.apache.catalina.LifecycleException: A child container failed during start

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)

        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 6 more


30-Jun-2019 18:18:22.455 SEVERE [main] org.apache.catalina.startup.Catalina.start The required Server component failed to start so Tomcat is unable to start.

 org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:630)

        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:498)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 7 more

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 9 more

Caused by: org.apache.catalina.LifecycleException: A child container failed during start

        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)

        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

        ... 11 more


30-Jun-2019 18:18:22.456 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-80"]

30-Jun-2019 18:18:22.456 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]

30-Jun-2019 18:18:22.456 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina

30-Jun-2019 18:18:22.459 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-80"]

30-Jun-2019 18:18:22.460 SEVERE [main] org.apache.coyote.AbstractProtocol.destroy Failed to destroy end point associated with ProtocolHandler ["http-nio-80"]

 java.lang.NullPointerException

        at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315)

        at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491)

        at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:896)

        at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)

        at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:634)

        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:498)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)


30-Jun-2019 18:18:22.461 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]

30-Jun-2019 18:18:22.461 SEVERE [main] org.apache.coyote.AbstractProtocol.destroy Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]

 java.lang.NullPointerException

        at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315)

        at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491)

        at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:896)

        at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)

        at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)

        at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:634)

        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:498)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

问题是在我改的server.xml文件中加的最后一句

<Context docBase="D:/images4o2o/upload/item" path="/upload/item" reloadable="true"/>。但是我不知道要怎么改



0
5
翔仔
回复
慕虎0518913
同学好,你tomcat使用的是80端口?可以改成8080试试? 然后参照手记去弄看 http://www.imooc.com/article/20583
2019-07-03
共5条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程