ubuntu server 14.04 启动项目“权限不够 ”的解决

macrogoal 发布于 2015/08/08 18:10
阅读 1K+
收藏 0

控制台输出:

......

2015-08-08 18:00:52 WARN [Class:AbstractLifeCycle->Thread:main] FAILED SelectChannelConnector@0.0.0.0:80: java.net.SocketException: 权限不够
java.net.SocketException: 权限不够
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:437)
    at sun.nio.ch.Net.bind(Net.java:429)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:293)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at cn.osworks.aos.core.server.AOSServer.start(Unknown Source)
    at cn.osworks.aos.AOS.main(AOS.java:25)
2015-08-08 18:00:52 WARN [Class:AbstractLifeCycle->Thread:main] FAILED org.eclipse.jetty.server.Server@1117b3d: java.net.SocketException: 权限不够
java.net.SocketException: 权限不够
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:437)
    at sun.nio.ch.Net.bind(Net.java:429)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
    at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:316)
    at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:265)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.Server.doStart(Server.java:293)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at cn.osworks.aos.core.server.AOSServer.start(Unknown Source)
    at cn.osworks.aos.AOS.main(AOS.java:25)
2015-08-08 18:00:52 ERROR [Class:AOSServer->Thread:main] AOS启动失败
AOS启动失败 | AOS项目主页 >>http://git.oschina.net/osworks/AOS

原因:linux下使用1024以下的端口需要root权限

修改:package cn.osworks.aos 下 “aosServer.setPort(80);”端口号

加载中
0
Feng_Yu
Feng_Yu
其实有办法用普通用户身份bind特权端口,而且ubuntu还提供了这个方案。google之
返回顶部
顶部