0

我的 WebApplication 托管在 apache tomcat 上,当我尝试访问该网站时,它只会继续加载并且没有返回任何网页。

当我检查 apache-tomcat 目录时,这些目录中有堆转储。

然后我重新启动了我的服务器,重新启动后网络应用程序不起作用。

当我检查 catalina 日志时,我发现了以下语句:

SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed: java.net.BindException: The socket name is already in use.:8080
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1019)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:578)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:782)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:504)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Oct 19, 2012 7:27:04 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2281 ms
Oct 19, 2012 7:27:04 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 19, 2012 7:27:04 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.25
Oct 19, 2012 7:27:04 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Oct 19, 2012 7:27:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/sun/student0/webapps/WEB-INF/lib/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/sun/student0/webapps/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/sun/student0/webapps/WEB-INF/lib/javax.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/sun/student0/webapps/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:05 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/sun/student0/webapps/WEB-INF/lib/tomcat-5.5-servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2012-10-19 07:27:06 - Database - Driver: com.sybase.jdbc2.jdbc.SybDriver  URL: jdbc:sybase:Tds:Student:2025/student  User: studentweb
2012-10-19 07:27:06 - Connection Pool - Min: 1  Max: 1  Days: 1.0
Oct 19, 2012 7:27:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/apache-tomcat-5.5.25/webapps/ROOT/WEB-INF/lib/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/apache-tomcat-5.5.25/webapps/ROOT/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/apache-tomcat-5.5.25/webapps/ROOT/WEB-INF/lib/javax.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/apache-tomcat-5.5.25/webapps/ROOT/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:07 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/apache-tomcat-5.5.25/webapps/ROOT/WEB-INF/lib/tomcat-5.5-servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Oct 19, 2012 7:27:08 AM org.apache.coyote.http11.Http11BaseProtocol start
SEVERE: Error starting endpoint
java.net.BindException: The socket name is already in use.:8080
    at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:298)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:313)
    at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:151)
    at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:76)
    at org.apache.catalina.connector.Connector.start(Connector.java:1090)
    at org.apache.catalina.core.StandardService.start(StandardService.java:457)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Oct 19, 2012 7:27:08 AM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start: 
LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.net.BindException: The socket name is already in use.:8080
    at org.apache.catalina.connector.Connector.start(Connector.java:1097)
    at org.apache.catalina.core.StandardService.start(StandardService.java:457)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Oct 19, 2012 7:27:08 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3489 ms
4

1 回答 1

1

您已经绑定了 8080 端口,更改 tomcat 端口并尝试重新启动

1) 在 {Tomcat 安装文件夹}\conf\ 中找到 server.xml

2)找到以下类似的陈述

 <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />

或者

<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />

将 8080 更改为您选择的任何其他端口,保存文件,然后启动 tomcat。

于 2012-10-19T11:38:15.160 回答