本文介绍了如何解决与Heroku的Proximo java.net.BindException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku上安装了Proximo插件,并且在将命令添加到现有命令时,我得到了Java的BindException。这就是我的前缀命令的样子: web:bin / proximo sh target / bin / webapp 并且只要我删除了Proximo部件( bin / proximo ),应用程序启动时不会出错。



这是完整的堆栈跟踪。我缺少什么?

 线程main中的异常java.net.BindException:无法分配请求的地址
at sun.nio.ch.Net.bind0(本地方法)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net .java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:162)
at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:240)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
at org.eclipse.jetty.server.Server.doStart(Server.java:270)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)




因此:

  web:bin / proximo [您现有的命令] 

需要包括这个,例如:

  web:bin / proximo [您现有的命令]  - p $ PORT 

或任何您需要指定您的Web进程运行的端口。


I have installed the Proximo add-on on Heroku and when prepending the command to my existing command, I get a BindException from Java. This is how my prepended command looks: web: bin/proximo sh target/bin/webapp and as soon as I remove the Proximo part (bin/proximo), the application starts up with no errors.

This is the full stacktrace. What am I missing?

Exception in thread "main" java.net.BindException: Cannot assign requested address
 at sun.nio.ch.Net.bind0(Native Method)
 at sun.nio.ch.Net.bind(Net.java:344)
 at sun.nio.ch.Net.bind(Net.java:336)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
 at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:162)
 at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:297)
 at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:240)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
 at org.eclipse.jetty.server.Server.doStart(Server.java:270)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)
解决方案

Remember you can only use the port that Heroku provides in the $PORT var.

Therefore:

web: bin/proximo [your existing command]

needs to include this, e.g:

web: bin/proximo [your existing command] -p $PORT

or whatever you need to dictate the port your web process runs on.

这篇关于如何解决与Heroku的Proximo java.net.BindException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 06:54