尝试将Apache Tomcat端口从8080更改为80时出现内存错误

时间:2012-01-23 18:32:24

标签: apache tomcat port

我正在尝试在VPS上安装Tomcat以在端口80而不是8080上运行,但是当我在Tomcat目录中编辑server.xml文件的设置,并尝试重新启动Tomcat时,我'得到这个错误:

  

2012年1月23日上午9:55:46 org.apache.coyote.http11.Http11Protocol init   严重:初始化端点java.net.SocketException时出错:不能   分配内存           at java.net.PlainSocketImpl.socketBind(Native Method)           在java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)           在java.net.ServerSocket.bind(ServerSocket.java:336)           在java.net.ServerSocket。(ServerSocket.java:202)           在java.net.ServerSocket。(ServerSocket.java:158)           在org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)           在org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)           在org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)           在org.apache.catalina.connector.Connector.initialize(Connector.java:1014)           在org.apache.catalina.core.StandardService.initialize(StandardService.java:680)           在org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)           在org.apache.catalina.startup.Catalina.load(Catalina.java:524)           在org.apache.catalina.startup.Catalina.load(Catalina.java:548)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)           在java.lang.reflect.Method.invoke(Method.java:616)           在org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)           在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)1月23日,   2012 9:55:46 am org.apache.catalina.startup.Catalina加载SEVERE:   Catalina.start LifecycleException:协议处理程序初始化   失败:java.net.SocketException:无法分配内存           在org.apache.catalina.connector.Connector.initialize(Connector.java:1016)           在org.apache.catalina.core.StandardService.initialize(StandardService.java:680)           在org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)           在org.apache.catalina.startup.Catalina.load(Catalina.java:524)           在org.apache.catalina.startup.Catalina.load(Catalina.java:548)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)           在java.lang.reflect.Method.invoke(Method.java:616)           在org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)           在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

不确定这意味着什么......这是否意味着我没有足够的内存?有没有其他方法可以让Tomcat在端口80上运行?

编辑:这是输入free -m时的输出:

total       used       free     shared    buffers     cached
Mem:   1024        748        275          0          0          0
-/+ buffers/cache:   748        275
Swap:   0          0          0

1 个答案:

答案 0 :(得分:3)

我在OpenVZ上使用authbind在端口80上运行时遇到了与Tomcat相同的问题。我通过从OpenJDK切换到Sun Java解决了这个问题。