Tomcat start error: Java.net.BindException:Permission denied <null>:80

Source: Internet
Author: User
Tags tomcat server

1, start error display
[Org.springframework.web.servlet.DispatcherServlet] Frameworkservlet ' SPRINGMVC ': initialization completed in 382 Msjun, 6:39:06 PM org.apache.coyote.http11.Http11Pr OtocolStartSevere:error starting endpointjava.net.BindException:Permission denied <NULL: the     atOrg.apache.tomcat.util.net.JIoEndpoint.init (Jioendpoint.java:549) atOrg.apache.tomcat.util.net.JIoEndpoint.Start(Jioendpoint.java:565) atOrg.apache.coyote.http11.Http11Protocol.Start(Http11protocol.java:207) atOrg.apache.catalina.connector.Connector.Start(Connector.java:1196) atOrg.apache.catalina.core.StandardService.Start(Standardservice.java:540) atOrg.apache.catalina.core.StandardServer.Start(Standardserver.java:754) atOrg.apache.catalina.startup.Catalina.Start(Catalina.java:595) atSUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) atSun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java: $) atSun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java: +) atJava.lang.reflect.Method.invoke (Method.java:601) atOrg.apache.catalina.startup.Bootstrap.Start(Bootstrap.java:289) atOrg.apache.catalina.startup.Bootstrap.main (Bootstrap.java:414) caused by: Java.net.BindException:Permission denied atJava.net.PlainSocketImpl.socketBind (Native Method) atJava.net.AbstractPlainSocketImpl.bind (Abstractplainsocketimpl.java:376) atJava.net.ServerSocket.bind (Serversocket.java:376) atJava.net.serversocket.<init> (Serversocket.java:237) atJava.net.serversocket.<init> (Serversocket.java:181) atOrg.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket (Defaultserversocketfactory.java: -) atOrg.apache.tomcat.util.net.JIoEndpoint.init (Jioendpoint.java:538)    ... AMorejun on, - 6: the: .PM Org.apache.catalina.core.StandardServiceStartSevere:failed to StartConnector [connector[http/1.1- the]]lifecycleexception:service.getname ():"Catalina";ProtocolHandler StartFailed:java.net.BindException:Permission denied <NULL: the     atOrg.apache.catalina.connector.Connector.Start(Connector.java:1203) atOrg.apache.catalina.core.StandardService.Start(Standardservice.java:540) atOrg.apache.catalina.core.StandardServer.Start(Standardserver.java:754) atOrg.apache.catalina.startup.Catalina.Start(Catalina.java:595) atSUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) atSun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java: $) atSun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java: +) atJava.lang.reflect.Method.invoke (Method.java:601) atOrg.apache.catalina.startup.Bootstrap.Start(Bootstrap.java:289) atOrg.apache.catalina.startup.Bootstrap.main (Bootstrap.java:414) June on, - 6: the: .PM Org.apache.jk.common.ChannelSocket initINFO:JK:ajp13 Listening on/0.0. 0. 0:9109June on, - 6: the: .PM Org.apache.jk.server.JkMainStartINFO:JK Running id=0  Time=0/ -config=NULLJune on, - 6: the: .PM Org.apache.catalina.startup.CatalinaStartInfo:server Startupinch 6868Ms

< copyright, the article allows reprint, but must be linked to the source address, otherwise investigate legal liability!>
Original Blog Address: http://blog.csdn.net/mchdba/article/details/46335861
Hara Douglas Fir (MCHDBA)

Problem analysis: Only the root user can access the port number below 1024 on SuSE, and the rest of the users will not be able to access it.


2, Solution 2.1, modify the Tomcat server.xml configuration file, modify the port to 8081 (or more than 1024 port number, cannot conflict with other Tomcat ports on this machine)
[[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  = accept Count  = uriencoding  = "UTF-8"  redirectport  = "9 143 "/>  <!--A" Connector "using the shared thread pool-->  
2.2, then use the root user to log on to the server, execute the Port redirection command: iptables-t nat-a prerouting-p tcp–dport 80-j redirect–to-port 8081.

This means that when you access port 80, redirect to Port 8081, so that we can change to any port we need.

[root@tomcat57conf]# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8081[root@tomcat57conf]# 
2.3. Switch to the Tomcat account and start the Tomcat service

You can access it normally:

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 June on  -: the: -Cst -]; Root ofContext hierarchy[org.springframework.beans.factory.xml.xmlbeandefinitionreader]loading XML Bean definitions from classPath resource [spring.xml][org.springframework.beans.factory.xml.xmlbeandefinitionreader]loading XML bean Definitions from classPath resource [Spring-mybatis.xml][org.springframework.beans.factory.config.propertyplaceholderconfigurer] Loading Properties File from classPath resource [config.properties][org.springframework.beans.factory.support.defaultlistablebeanfactory] Pre-instantiating singletonsinchOrg.s[email protected] ind7c3ff: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 ofFactory 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 Completedinch 1433Ms[org.springframework.web.servlet.dispatcherservlet]frameworkservlet' Springmvc ': Initialization started[org.springframework.web.context.support.xmlwebapplicationcontext]refreshing Webapplicationcontext for namespace ' Springmvc-servlet ': startup Date [Mon June on  -: the: $Cst -]; Parent:root webapplicationcontext[org.springframework.beans.factory.xml.xmlbeandefinitionreader]loading XML Bean Definitions from classPath resource [spring-mvc.xml][org.springframework.beans.factory.support.defaultlistablebeanfactory] Pre-instantiating singletonsinchOrg.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] inD7c3ff[org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping]MappedURL path [/receiptcontroller/receivereceiptdata] onto handler' Receiptcontroller '[Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]MappedURL path [/receiptcontroller/receivereceiptdata.*] onto handler' Receiptcontroller '[Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]MappedURL path [/receiptcontroller/receivereceiptdata/] onto handler' Receiptcontroller '[Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]MappedURL path [/receiptcontroller/receiveposinfodata] onto handler' Receiptcontroller '[Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]MappedURL path [/receiptcontroller/receiveposinfodata.*] onto handler' Receiptcontroller '[Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]MappedURL path [/receiptcontroller/receiveposinfodata/] onto handler' Receiptcontroller '[Org.springframework.web.servlet.DispatcherServlet] Frameworkservlet' Springmvc ': Initialization completedinch 377Msjun on, - 6: the: $PM org.apache.coyote.http11.Http11Protocol startinfo:starting Coyote http/1.1  onhttp-8081June on, - 6: the: $PM Org.apache.jk.common.ChannelSocket initINFO:JK:ajp13 Listening on/0.0.0.0:9109June on, - 6: the: $PM Org.apache.jk.server.JkMain STARTINFO:JK Running id=0Time=0/ -Config=nulljun on, - 6: the: $PM Org.apache.catalina.startup.Catalina Startinfo:server Startupinch 6827Ms^c

Tomcat start error: Java.net.BindException:Permission denied <null>:80

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.