设置是:
亚马逊EC2
Tomcat(安全转发到8443)
Apache 2.2
我运行shutdown.sh,没有错误.
但是当我试图破坏startup.sh时,我收到此错误:
07-Nov-2011 17:40:40 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib 07-Nov-2011 17:40:41 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:40:41 org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176) at org.apache.catalina.connector.Connector.initialize(Connector.java:1022) at org.apache.catalina.core.StandardService.initialize(StandardService.java:703) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838) at org.apache.catalina.startup.Catalina.load(Catalina.java:538) at org.apache.catalina.startup.Catalina.load(Catalina.java:562) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:336) at java.net.ServerSocket.bind(ServerSocket.java:336) at java.net.ServerSocket. (ServerSocket.java:202) at java.net.ServerSocket. (ServerSocket.java:158) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538) ... 12 more 07-Nov-2011 17:40:41 org.apache.catalina.core.StandardService initialize SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8080]] LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use :8080 at org.apache.catalina.connector.Connector.initialize(Connector.java:1024) at org.apache.catalina.core.StandardService.initialize(StandardService.java:703) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838) at org.apache.catalina.startup.Catalina.load(Catalina.java:538) at org.apache.catalina.startup.Catalina.load(Catalina.java:562) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 07-Nov-2011 17:40:41 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8443 07-Nov-2011 17:40:41 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 615 ms 07-Nov-2011 17:40:41 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 07-Nov-2011 17:40:41 org.apache.catalina.core.StandardEngine start INFO: Starting service Catalina 07-Nov-2011 17:40:41 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.33 07-Nov-2011 17:40:41 org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor host-manager.xml 07-Nov-2011 17:40:41 org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor manager.xml 07-Nov-2011 17:40:41 org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive test.war log4j:WARN No appenders could be found for logger (StackTrace). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. log4j:ERROR Error initializing log4j: grails/plugins/springsecurity/SecurityConfigType : Unsupported major.minor version 51.0 (unable to load class grails.plugins.springsecurity.SecurityConfigType) java.lang.UnsupportedClassVersionError: grails/plugins/springsecurity/SecurityConfigType : Unsupported major.minor version 51.0 (unable to load class grails.plugins.springsecurity.SecurityConfigType) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at Config.class$(Config.groovy) at Config.$get$$class$grails$plugins$springsecurity$SecurityConfigType(Config.groovy) at Config.run(Config.groovy:116) 07-Nov-2011 17:40:43 org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart 07-Nov-2011 17:40:43 org.apache.catalina.core.StandardContext start SEVERE: Context [/test] startup failed due to previous errors 07-Nov-2011 17:40:43 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/test] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 07-Nov-2011 17:40:43 org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive browser.war 07-Nov-2011 17:40:43 org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory examples 07-Nov-2011 17:40:43 org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory ROOT 07-Nov-2011 17:40:43 org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory docs 07-Nov-2011 17:40:43 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:40:43 org.apache.coyote.http11.Http11Protocol start SEVERE: Error starting endpoint java.net.BindException: Address already in use :8080 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549) at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565) at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203) at org.apache.catalina.connector.Connector.start(Connector.java:1095) at org.apache.catalina.core.StandardService.start(StandardService.java:540) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:336) at java.net.ServerSocket.bind(ServerSocket.java:336) at java.net.ServerSocket. (ServerSocket.java:202) at java.net.ServerSocket. (ServerSocket.java:158) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538) ... 12 more 07-Nov-2011 17:40:43 org.apache.catalina.core.StandardService start SEVERE: Failed to start connector [Connector[HTTP/1.1-8080]] LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use :8080 at org.apache.catalina.connector.Connector.start(Connector.java:1102) at org.apache.catalina.core.StandardService.start(StandardService.java:540) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 07-Nov-2011 17:40:43 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8443 07-Nov-2011 17:40:43 org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 07-Nov-2011 17:40:43 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/120 config=null 07-Nov-2011 17:40:43 org.apache.catalina.startup.Catalina start INFO: Server startup in 2286 ms 07-Nov-2011 17:42:14 org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:42:14 org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:42:14 org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8443 07-Nov-2011 17:42:15 org.apache.catalina.core.StandardService stop INFO: Stopping service Catalina 07-Nov-2011 17:42:15 org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:42:15 org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8080 07-Nov-2011 17:42:15 org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8443
我已经尝试了一些命令,比如netstat -aon | grep 8080
我已经尝试ps -efl | grep java
并使用kill
pkill java
等等来杀死该进程...
这是什么 netstat -aon
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State Timer tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN off (0.00/0/0) tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0) tcp 0 0 10.226.122.156:22 109.58.56.15:49215 ESTABLISHED keepalive (5354.40/0/0) tcp 0 0 :::80 :::* LISTEN off (0.00/0/0) tcp 0 0 :::22 :::* LISTEN off (0.00/0/0) udp 0 0 0.0.0.0:68 0.0.0.0:* off (0.00/0/0) udp 0 0 10.226.122.156:123 0.0.0.0:* off (0.00/0/0) udp 0 0 127.0.0.1:123 0.0.0.0:* off (0.00/0/0) udp 0 0 0.0.0.0:123 0.0.0.0:* off (0.00/0/0) udp 0 0 ::1:123 :::* off (0.00/0/0) udp 0 0 fe80::1031:3cff:fe0:123 :::* off (0.00/0/0) udp 0 0 :::123 :::* off (0.00/0/0) Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 2337 @/tmp/fam-root- unix 2 [ ACC ] STREAM LISTENING 409 @/com/ubuntu/upstart unix 2 [ ] DGRAM 644 @/org/kernel/udev/udevd unix 8 [ ] DGRAM 1513 /dev/log unix 3 [ ] STREAM CONNECTED 38302 unix 3 [ ] STREAM CONNECTED 38301 unix 2 [ ] DGRAM 38297 unix 2 [ ] DGRAM 22149 unix 3 [ ] STREAM CONNECTED 2340 @/tmp/fam-root- unix 3 [ ] STREAM CONNECTED 2339 unix 2 [ ] DGRAM 1998 unix 2 [ ] DGRAM 1918 unix 2 [ ] DGRAM 1895 unix 2 [ ] DGRAM 1819 unix 3 [ ] DGRAM 648 unix 3 [ ] DGRAM 647
有什么想法或指针吗?
我也有同样的问题.尝试了这个主题中建议的所有选项.但没有帮助.然后就跑了:
ps -awwef | grep tomcat
并发现一些陈旧的过程正在运行.我用(-15而不是-9)杀了它
sudo kill -15
和woot!有效.重启tomcat没有任何问题.
永远不要使用信号-9终止进程,因为这种类型的终止进程会使其资源出现在系统中,只能在服务器重启后删除.仅在极端紧急情况下才使用kill -9.最好使用kill -15,因为它可能需要一些时间来清理资源,但是你总是能够正确地刷新整个资源集,这个过程正在消耗.所以最有可能的是,tomcat没有工作,因为它留下了内存中留下的一些资源.因此,要么执行重新启动,要么尝试查找以下内容:
通过lsof命令并使用tomcat grep它.它会向你展示任何与它相关的tomcat
lsof | grep tomcat
搜索文件系统上的任何pid锁文件,由tomcat保留.
还试着发出:
lsof -i TCP | grep 8080
端口号在$ TOMCAT_HOME/conf/server.xml中配置
如果正在使用端口8080,请在server.xml文件中进行更改.我在server.xml中看起来像这样
仅仅运行lsof可能还不够.我建议这个命令:
sudo lsof -i :8080
然后你可以杀死持有端口的任何进程(很可能是另一个tomcat实例).