当我尝试通过intellij
的play2插件运行我的(本地)播放应用程序时,我得到:
[ERROR] [06/03/2017 23:21:10.985] [play-dev-mode-akka.actor.default-dispatcher-2] [akka://play-dev-mode/system/IO-TCP/selectors/$a/0] Bind failed for TCP channel on endpoint [/0.0.0.0:80]
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at akka.io.TcpListener.liftedTree1$1(TcpListener.scala:56)
at akka.io.TcpListener.<init>(TcpListener.scala:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at akka.util.Reflect$.instantiate(Reflect.scala:65)
at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:555)
at akka.actor.ActorCell.create(ActorCell.scala:581)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:454)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:476)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
akka.stream.BindFailedException$: bind failed
但是,如果我通过sbt run
运行它,一切都像魅力一样。
1)为什么?
2)我该如何解决这个问题? (在这里运行Linux 4.11 - 我知道端口只允许“sudoers”,但后来我想知道为什么sbt
- 方式有效)
3)在“调试模式”下运行播放的任何其他方式?我想设置一些断点并分析流程。
答案 0 :(得分:1)
之前我遇到过类似的问题。部署到端口需要权限,如果要在本地维护服务,可以将端口更改为9000(如果您不希望发生此问题)。然后,在生产中部署时,可以将其更改为80并遵循本指南:
答案 1 :(得分:0)
如果将build.sbt更改为侦听端口80,请删除该行。 IntelliJ仍然认为应用程序希望在80上运行
还有:
如果更改了application.conf,请确保端口未设置为80。