Localhost - 连接重置错误

时间:2017-10-03 18:54:59

标签: java tomcat localhost

我正在尝试使用Tomcat 8从eclipse运行Java应用程序,但我有一个“ERR_CONNECTION_RESET”。

的Server.xml

#contact {
    background-color: #696969;
    /* height: 750px; */
}

在控制台中,当我尝试访问网址“localhost:9081 / cheexport”时,我收到此错误消息

<?xml version="1.0" encoding="UTF-8"?>
<Server port="9081" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
    <Resource auth="Container" description="User database that can be updated and saved"
        factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase"
        pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase" />
</GlobalNamingResources>
<Service name="Catalina">
    <Connector connectionTimeout="20000" port="8005" protocol="HTTP/1.1" redirectPort="8443" />
    <Engine defaultHost="localhost" name="Catalina">
        <Realm className="org.apache.catalina.realm.LockOutRealm">
            <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
        </Realm>
        <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log" suffix=".txt" />
            <Context docBase="CheExport" path="/cheexport" reloadable="true" source="org.eclipse.jst.jee.server:CheExport" />
        </Host>
    </Engine>
</Service>
</Server>

我尝试使用Chrome和Firefox,我遇到了同样的错误,而其他每个页面的导航都有效

1 个答案:

答案 0 :(得分:1)

您正在通过关闭端口访问Web服务器(这会关闭Tomcat,从而导致连接重置错误)。侦听端口为8005.尝试使用网址localhost:8005/cheexport

否则,如果要使用端口9081,请在server.xml中切换服务器端口和连接器端口。

希望这有帮助。