tomcat启动报错:java.net.BindException: Permission denied <null>:80

1,启动报错显示

[org.springframework.web.servlet.DispatcherServlet]FrameworkServlet ‘springMvc‘: initialization completed in 382 ms
Jun 01, 2015 6:39:06 PM org.apache.coyote.http11.Http11Protocol start
SEVERE: Error starting endpoint
java.net.BindException: Permission denied <null>:80
    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:207)
    at org.apache.catalina.connector.Connector.start(Connector.java:1196)
    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:601)
    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: Permission denied
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    at java.net.ServerSocket.bind(ServerSocket.java:376)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at java.net.ServerSocket.<init>(ServerSocket.java:181)
    at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    ... 12 more

Jun 01, 2015 6:39:06 PM org.apache.catalina.core.StandardService start
SEVERE: Failed to start connector [Connector[HTTP/1.1-80]]
LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.net.BindException: Permission denied <null>:80
    at org.apache.catalina.connector.Connector.start(Connector.java:1203)
    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:601)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Jun 01, 2015 6:39:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:9109
Jun 01, 2015 6:39:06 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/17  config=null
Jun 01, 2015 6:39:06 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6868 ms


<版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!>

原博客地址: http://blog.csdn.net/mchdba/article/details/46335861

原作者:黄杉 (mchdba)



问题分析:在Suse上只有root用户才可以访问1024以下的端口号,其余用户不能访问。

2,解决方案

2.1,修改Tomcat的server.xml配置文件,将端口修改为8081(或者其他1024以上的端口号,不能与本机上的其它Tomcat端口冲突)

[[email protected]]# vim /usr/local/app/apache-tomcat-6.0.37_hechuang_lib/conf/server.xml
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="30000"
               maxThreads="2000"
               acceptCount="2000"
               URIEncoding="UTF-8"
               redirectPort="9143" />
    <!-- A "Connector" using the shared thread pool-->

2.2,然后使用root用户登录服务器,执行端口重定向命令:iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8081。

意思就是当访问80端口时重定向到8081端口,这样,我们可以改成任何我们需要的端口啦。

[root@tomcat57conf]# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8081
[root@tomcat57conf]# 

2.3,切换到tomcat账号,启动tomcat服务

就可以正常访问了:

INFO: Deploying web application directory databox
[org.springframework.web.context.ContextLoader]Root WebApplicationContext: initialization started
[org.springframework.web.context.support.XmlWebApplicationContext]Refreshing Root WebApplicationContext: startup date [Mon Jun 01 18:42:44 CST 2015]; root of context hierarchy
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from class path resource [spring.xml]
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from class path resource [spring-mybatis.xml]
[org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]Loading properties file from class path resource [config.properties]
[org.springframework.beans.factory.support.DefaultListableBeanFactory]Pre-instantiating singletons in org.s[email protected]71d7c3ff: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,receiptService,posmonitorService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,transactionAdvice,org.springframework.aop.config.internalAutoProxyCreator,transactionPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,receiptMapper,posMonitorLogsMapper]; root of factory hierarchy
[com.alibaba.druid.pool.DruidAbstractDataSource]maxIdle is deprecated
[com.alibaba.druid.pool.DruidDataSource]{dataSource-1} inited
[org.springframework.web.context.ContextLoader]Root WebApplicationContext: initialization completed in 1433 ms
[org.springframework.web.servlet.DispatcherServlet]FrameworkServlet ‘springMvc‘: initialization started
[org.springframework.web.context.support.XmlWebApplicationContext]Refreshing WebApplicationContext for namespace ‘springMvc-servlet‘: startup date [Mon Jun 01 18:42:45 CST 2015]; parent: Root WebApplicationContext
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from class path resource [spring-mvc.xml]
[org.springframework.beans.factory.support.DefaultListableBeanFactory]Pre-instantiating singletons in org.s[email protected]5d4ee178: defining beans [receiptController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,mappingJacksonHttpMessageConverter,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,multipartResolver,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; parent: org.s[email protected]71d7c3ff
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receiveReceiptData] onto handler ‘receiptController‘
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receiveReceiptData.*] onto handler ‘receiptController‘
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receiveReceiptData/] onto handler ‘receiptController‘
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receivePosInfoData] onto handler ‘receiptController‘
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receivePosInfoData.*] onto handler ‘receiptController‘
[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapped URL path [/receiptController/receivePosInfoData/] onto handler ‘receiptController‘
[org.springframework.web.servlet.DispatcherServlet]FrameworkServlet ‘springMvc‘: initialization completed in 377 ms
Jun 01, 2015 6:42:45 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8081
Jun 01, 2015 6:42:45 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:9109
Jun 01, 2015 6:42:45 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16  config=null
Jun 01, 2015 6:42:45 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6827 ms
^C
时间: 2024-10-03 22:53:45

tomcat启动报错:java.net.BindException: Permission denied <null>:80的相关文章

Tomcat 启动报错 java.net.BindException: Permission denied :80

Tomcat一启动就报如下错误: Caused by: java.net.BindException: Permission denied <null>:80 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:410) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640) at org.apache.coyote.

解决mac os x下 tomcat启动报 java.net.BindException: Permission denied &lt;null&gt;:80 错误

我在mac os x上启动tomcat的时候,报 java.net.BindException: Permission denied <null>:80,java.net.BindException: Permission denied <null>:443错误,443时因为我要弃用ssl服务. Mac OS X 因为要绑定1024以下的端口需要ROOT权限, 但是如果用root权限启动eclipse或tomcat又会造成, 启动创建的各类文件是root的,普通用户无法删除. 为此

Tomcat启动时报错:java.net.BindException: Permission denied &lt;null&gt;:80 【转载】

本文转载自: http://blog.sina.com.cn/s/blog_4550f3ca0101g37l.html 问题起因:做负载均衡时需要将Web工程与Wap工程同时部署在一台Suse服务器上,为方便日后维护,我们分别为Web工程与Wap工程分配了不同的用户进行部署,并且端口使用分别为8080与80,Web工程使用默认8080端口,Tomcat正常启动并能正常访问,Wap工程使用80端口(修改server.xml),Tomcat启动一系列错误(见问题描述). 问题描述:Tomcat启动时

Tomcat启动报错java.net.AbstractPlainSocketImpl(java/net/AbstractPlainSocketImpl.java:178:-1)Struts在网络复杂情况下启动报错解决办法

SSH项目 在网络复杂的情况(具体规律未知)下,Tomcat启动时,报如下错误: [ERROR] 2014-08-12 14:52:58,484 [org.apache.struts2.dispatcher.Dispatcher :27] - Dispatcher initialization failedUnable to load configuration. - Class: java.net.AbstractPlainSocketImplFile: AbstractPlainSocket

Tomcat启动报错java.lang.ClassNotFoundException: javax.el.ExpressionFactory

严重: Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0': Invocation of init method failed; nested exception

Tomcat启动报错:严重: StandardServer.await: create[8005] java.net.BindException: Cannot assign requested address

org.apache.catalina.core.StandardServer await        SEVERE: StandardServer.await: create[8005]:        java.net.BindException: Cannot assign requested address java.net.BindException: Cannot assign requested address        at java.net.PlainSocketImpl

tomcat下部署了多个项目启动报错java web error:Choose unique values for the &#39;webAppRootKey&#39; context-param in your web.xml files

应该是tomcat下部署了多个项目且都使用log4j. <!--如果不定义webAppRootKey参数,那么webAppRootKey就是缺省的"webapp.root".但最好设置,以免项目之间的名称冲突. 定义以后,在Web Container启动时将把ROOT的绝对路径写到系统变量里. 然后log4j的配置文件里就可以用${webName.root }来表示Web目录的绝对路径,把log文件存放于webapp中. 此参数用于后面的“Log4jConfigListener”

DRP问题集结(一)-Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

问题一:  Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory 问题二:[Error]JavaWeb: 严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] 问题三:The APR based Apache Tomcat Native library which a

tomcat启动报错,找不到相应的 queue,从而引发内存泄漏

tomcat启动报错,无法创建 bean listenerStatusChangeDealHandler, no queue 'STOCK.NOTIFY_CHANGE.INTER.CACHE.QUEUE' in vhost 从启动日志来看,有时候仅会看到内存泄漏,而没有与queue相关的日志,非常easy走错方向. 依照 http://blog.csdn.net/wangjunjun2008/article/details/23375501 的方法能够看到具体日志,从而确定报错原因 tomcat