Jetty run failure

My old projects and new projects have started getting the following error:

Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.4.15.v20190215:run (default-cli) on project s2e-Api: Failure

It seems to happen because of this

com.google.common.util.concurrent.internal.InternalFutureFailureAccess scanned from multiple locations: jar:file:///C:/Users/non/.m2/repository/com/google/guava/failureaccess/1.0/failureaccess-1.0.jar!/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.class, jar:file:///C:/Users/non/.m2/repository/com/google/guava/guava/27.0-jre/guava-27.0-jre.jar!/com/google/common/util/concurrent/internal/InternalFutureFailureAccess.class
com.google.common.util.concurrent.internal.InternalFutures scanned from multiple locations: jar:file:///C:/Users/non/.m2/repository/com/google/guava/failureaccess/1.0/failureaccess-1.0.jar!/com/google/common/util/concurrent/internal/InternalFutures.class, jar:file:///C:/Users/non/.m2/repository/com/google/guava/guava/27.0-jre/guava-27.0-jre.jar!/com/google/common/util/concurrent/internal/InternalFutures.class

Though I wonder what I did to cause this issue. Can anyone solve it for me?

A class being scanned from multiple locations can lead to problems, but it’s not obvious that this is what’s causing your problem.

Could you share a bit more of the logs? Is there a stack trace or any other errors?

If you want to try solving the scanned from multiple locations issue, you could try running with a newer Guava version. At least guava-30.1-jre does not seem to contain those classes anymore, although I’m not sure what else changed in that version.

How much more? The jetty run log is huge. There was no stacktrace.

How would I change the guava version. I made every project from maven/vaadin archetypes.

You either have a dependency on Guava defined in your pom.xml, or then there is a transitive dependency on it. In this case you can find out where it comes from with mvn dependency:tree -Dincludes=com.google.guava.

Apparently Jetty might display that error if the address is already in use, i.e. something else is running on that port.

You can try running it with the -X flag to show debug output (e.g. mvn jetty:run -X).

The address is already in use. I ran the mvn jetty:run -X and got the following errors:

Caused by: java.net.BindException: Address already in use: bind

FAILED ServerConnector@1777ef25{HTTP/1.1,[http/1.1]
}{0.0.0.0:8080}: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080

FAILED MavenServerConnector@68a7ea1e{FAILED}: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080

FAILED Server@7b5d68fc{FAILED}[9.4.15.v20190215]
: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8080

I recently port-forwarded to port 8080, could that be the cause of the issue? I get the error after a fresh restart of my computer too.

I ran netstat -ano | findstr 8080 in cmd

and got this output

 TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       3528
  TCP    internal_ip:8080   external_ip:60121       FIN_WAIT_2      3528
  TCP    internal_ip:8080   external_ip:60140       TIME_WAIT       0
  TCP    internal_ip:8080   external_ip:60158       TIME_WAIT       0
  TCP    internal_ip:8080   external_ip:60176       FIN_WAIT_2      3528
  TCP    [::]
:8080              [::]
:0                 LISTENING       3528

If I run taskkill /pid 3528 /F in the CMD, I can now run jetty:run.

So it is a small fix. But how do I fix it long-term? How does people ideally run their Vaadin projects and port-forward to them?

Edit: I had not seen your previous reply when posting this, so it might not be relevant.

I suggest running a command to see what is listening on that port.

If you have Windows and PowerShell, you can run Get-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess.

[Here is a site]
(https://www.tecmint.com/find-out-which-process-listening-on-a-particular-port/) that lists a few way to get the process on Linux/Mac.

Once you have the process ID, you should be able to find it in the Task Manager on Windows or Activity Monitor on Mac. On Windows, you might have to click More details and then right click on a column and select PID to get the process ID to show.

I believe that 3528 is the process ID that you could look for in the Task Manager.