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.lang.NoClassDefFoundError: when having port conflict #1356
Comments
Confirmed. Can be easily replicated with the following barebones project. Note: this is an error during shutdown/stop. |
@nano-bot the tricky thing here is that jetty relies on a Shutdown thread to shut down properly. However, because the maven plugin is throwing an error, maven is taking away the classloader before the Shutdown thread can execute. |
In my case it's happening in a multi module process. See #1409 for comments. For jetty:start are you forking an external process to run jetty. To me that would be the best approach as you want it to continue to run after maven has finished. |
"continue to run after maven has finished" is worrisome. the jetty-maven-plugin is designed for development time only. In fact, its downright dangerous to run that way, as there's far too many artifacts in the classloader for a secure system (think all of maven + your build + its plugins for the entire reactor). |
@pauldaustin neither the "start" goal nor the "run" goal fork another process - they both execute in-process in maven. "start" is designed to be bound into a lifecycle execution in your pom, and work alongside the "stop" goal also bound to a lifecycle phase. The "run" goal is instead designed to be executed on the command line. The "stop" goal can also be run on the command line. If you wanted to start a forked jetty instance, then you need to use the "run-forked" command line goal instead. So let's rewind back to your original post. I assumed that you were running "mvn jetty:run" twice in 2 different windows for some undisclosed purpose. However, after your other post on #1409 it occurs to me that you might not be using the plugin correctly. Perhaps you should have the "start" goal bound to a lifecycle execution phase in each of your war module poms. |
I thought my client was intending to run jetty using the maven jetty plugin (they are on a development server using jetty:run). I have now confirmed that is not the case for production so this is now not an issue. |
Closing issue. |
After upgrading jetty to version 9.4, I'm getting the following issue while the initializing server class
|
Starting with 9.3.15.v20161220 jetty-maven-plugin throws NoClassDefError when running jetty:run twice and therefore port conflict occurs. It looks like when there's port conflict some sort of exception is thrown, but it can't be find in plugin binary.
Steps to reproduce:
Expected:
Simple error message about port conflict:
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.2.v20150730:run (default-cli) on project registration: Failure: Address already in use -> [Help 1]
Actual:
The text was updated successfully, but these errors were encountered: