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

Handle reserved server address #1665

Closed
ripla opened this issue Apr 3, 2018 · 4 comments
Closed

Handle reserved server address #1665

ripla opened this issue Apr 3, 2018 · 4 comments
Assignees
Milestone

Comments

@ripla
Copy link
Contributor

ripla commented Apr 3, 2018

There is rare exception that has existed for a long while:

Error:
Jetty lifecycle failed
java.net.BindException: Address already in use
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Net.java:433)
        at java.base/sun.nio.ch.Net.bind(Net.java:425)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:225)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:401)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at com.vaadin.designer2.server.AbstractEditorApplicationServer.start(AbstractEditorApplicationServer.java:433)
        at com.vaadin.designer2.server.AbstractEditorApplicationServer.start(AbstractEditorApplicationServer.java:410)
        at com.vaadin.designer2.server.AbstractEditorApplicationServer.registerContextPath(AbstractEditorApplicationServer.java:176)

Assuming the error situation is reasonable, the exception should be handled in a graceful way. In an optimal scenario, Designer would just try another port until a free one is found.

@ripla
Copy link
Contributor Author

ripla commented Apr 3, 2018

Note that this affects both editors since they use the same server.

@qtdzz
Copy link
Contributor

qtdzz commented May 14, 2018

A user reported the same stacktrace after opening a created Design in a newly created vaadin-archetype-application-multimodule project.

Java: 1.8.0_152 
Eclipse: org.eclipse.epp.package.jee.product 4.7.3.20180405-1200 
Designer: 3.0.1 
Vaadin: 8.4.1

@mjvesa
Copy link

mjvesa commented May 29, 2018

Another report of the same issue when a user has opened an existing project using a freshly updated designer.

OS: Windows 10 10.0 amd64
Browser: Mozilla/5.0 (Windows NT 6.2; Win64; x64; Trident/7.0; ASU2JS; rv:11.0) like Gecko
Java: 1.8.0_171
Eclipse: org.eclipse.epp.package.jee.product 4.7.3.20180405-1200
Designer: 3.0.2 

@ripla ripla added the backlog label May 30, 2018
@tanbt tanbt self-assigned this Jun 11, 2018
@szolo szolo self-assigned this Jun 14, 2018
@tanbt
Copy link
Contributor

tanbt commented Jun 18, 2018

There're two problems in Eclipse regarding this issue.

1. There's a thread still running after closing/removing the project. This thread restarts the server again and again.

Reproduce:

  • Open a Vaadin 10 project
  • Open a design
  • Close or remove the project
    Actual:
  • Eclipse log shows still that the server is restarted again and again with a new port
    Expect:
  • Nothing happens. The server should completely be stopped.

2 . The BindException: Address already in use

Reproduce:

  • Open a Vaadin 10 project
  • Open a design
  • Close or remove the project
  • Open/Import the project again
  • Open a design
    Actual:
  • Eclipse log shows the BindException and the editor keeps flashing.
    Expect:
  • No exception.

@szolo szolo added this to the 3.0.5 milestone Jul 4, 2018
@szolo szolo closed this as completed Jul 4, 2018
@ripla ripla removed the backlog label Jul 31, 2018
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

5 participants