Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.bindexception cannot assign requested address (bind failed) #12

Open
hfazai opened this issue Jun 14, 2021 · 7 comments
Open

Comments

@hfazai
Copy link

hfazai commented Jun 14, 2021

I'm trying to run my app using 'appRun' gretty task but i'm having this error : java.net.bindexception cannot assign requested address (bind failed)

I'm using :

  • gradle 6.8.3
  • Gretty : id("org.gretty") version "3.0.4"
  • Vaadin Gradle Plugin: id("com.vaadin") version "20.0.1"
  • vaadinVersion = "20.0.1"

Running in production mode:

vaadin {
  pnpmEnable = true
  productionMode = true
}

Any idea how to fix this? Thanks!

@caalador
Copy link
Contributor

Doesn't that mean that there is another process using the port where the application would open?
Check the usage of port 8080 and close the application using that or change the gretty port by adding the port to the gretty block in build.gradle

gretty {
  port = 9999
}

@hfazai
Copy link
Author

hfazai commented Jun 14, 2021

I tried with changing the port in gretty block:

gretty {
  contextPath = "/"
  servletContainer = "jetty9.4"
  httpPort = 9999
}

But still having the same issue.

@hfazai
Copy link
Author

hfazai commented Jun 14, 2021

@caalador
I changed to gretty 2.3.1. I get another error: Exception in thread "Thread-164" java.lang.IllegalStateException: The configuration :grettyNoSpringBoot was resolved from a thread not managed by Gradle.

@caalador
Copy link
Contributor

The last error is due to using an incompatible gretty version.
Some places seem to indicate that downgrading to 3.0.1 might help in some cases or changing from the servletContainer from 'jetty9.4' to 'tomcat8'

What os are you running on?
Also what else is on the stacktrace?

@hfazai
Copy link
Author

hfazai commented Jun 15, 2021

Downgrading to 3.0.1 resolves the problem 👍

  • My OS is Fedora 32
  • This is the stacktrace when using 3.0.4
* Exception is:
Caused by: java.net.BindException: Cannot assign requested address (bind failed)
at org.akhikhl.gretty.ServiceProtocol.createReader(ServiceProtocol.groovy:20)
at org.akhikhl.gretty.ServiceProtocol.createReader(ServiceProtocol.groovy)
at org.akhikhl.gretty.ServiceProtocol$createReader.call(Unknown Source)
at org.akhikhl.gretty.LauncherBase.beforeLaunch(LauncherBase.groovy:57)
at org.akhikhl.gretty.DefaultLauncher.super$2$beforeLaunch(DefaultLauncher.groovy)
at org.akhikhl.gretty.DefaultLauncher.beforeLaunch(DefaultLauncher.groovy:58)
at org.akhikhl.gretty.LauncherBase.launch(LauncherBase.groovy:141)
at org.akhikhl.gretty.Launcher$launch.call(Unknown Source)
at org.akhikhl.gretty.StartBaseTask.action(StartBaseTask.groovy:87)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 119 more

@caalador
Copy link
Contributor

It might be the same type of issue as gretty-gradle-plugin/gretty#147

This will need some more investigation, but good that you can get forward with the project.

@hfazai
Copy link
Author

hfazai commented Jun 15, 2021

@caalador Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants