I'm using IntelliJ Idea Community Edition IDE and I'm trying to run a Maven WebApp with Jetty by command line. I'm on a RedHat box
I run this command:
mvn clean install -P deployJetty -Djetty.port=8083
And I get this error:
Listening for transport dt_socket at address: 5005
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use
The funny thing is that when I close IntelliJ Idea, the 1099 port is released. I can't find the reason why and how Idea is using this port.
Any ideas ? Thank you.
Note: As a workaround, I'm closing Idea, running Jetty and then opening Idea (and I guess forcing it to pick another port)
Use this spin box to specify the port on which the built-in web server runs. By default this port is set to 63342 through which IntelliJ IDEA accepts connections from services. You can set the port number to any other value starting with 1024 and higher.
The port appears in the console when you start the app. I can see it via my endpoints tab (Appears next to Console) and then under the beans tab.
To stop a process, you can use ⌘F2 on macOS, or Ctrl+F2 on Windows/Linux.
I am sure IntelliJ Idea does not use 1099 port internally. I have used this PORT for Tomcat. I would suggest checking if any of idea plugins that you have installed are running on this port. Most of the operating systems can give you the application name that is running on that port.
Eg: lsof -w -n -i tcp:8080
would give me the application running on 8080 on my linux machine.
Hope this helps.
Go to terminal and kill the session
ps -aef | grep 1099
kill -9 PID
on windows :
step 1] find the process : netstat -ano or netstat -aon |find /i "listening" |find "Port no"
step 2] kill the process : Taskkill /F /IM (Process id obtained from above step)
Please see example below:
make sure you have localhost defined in your /etc/hosts
file, and that it's defined only once
localhost 127.0.0.1
it was leaving the maven process in intelliJ hanging which caused the port 1099 already in use
error even after changing the jmx port to something different.
On my Mac a process called "fsnotifier" is using port 1099. A google on this indicates that it's an IntelliJ file system watcher. Solved by using a different port for JMX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With