Java IntelliJ Idea IDE 使用端口 1099

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25373565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:14:50  来源:igfitidea点击:

IntelliJ Idea IDE using port 1099

javamavenintellij-ideajettyrmi

提问by mdjebaile

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

我正在使用 IntelliJ Idea Community Edition IDE,并且正在尝试通过命令行运行带有 Jetty 的 Maven WebApp。我在 RedHat 盒子上

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.

有趣的是,当我关闭 IntelliJ Idea 时,1099 端口被释放。我找不到 Idea 使用此端口的原因和方式。

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)

注意:作为一种解决方法,我正在关闭 Idea,运行 Jetty,然后打开 Idea(我想强制它选择另一个端口)

采纳答案by Showdawn

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.

我确信 Intellij Idea 不会在内部使用 1099 端口。我已将此端口用于 Tomcat。我建议检查您安装的任何想法插件是否在此端口上运行。大多数操作系统都可以为您提供在该端口上运行的应用程序名称。

Eg: lsof -w -n -i tcp:8080would give me the application running on 8080on my linux machine.

例如:lsof -w -n -i tcp:8080会给我在我的 linux 机器上的8080上运行的应用程序。

Hope this helps.

希望这可以帮助。

回答by Michael Christensen

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.

在我的 Mac 上,一个名为“fsnotifier”的进程正在使用端口 1099。谷歌对此表示它是一个 IntelliJ 文件系统观察程序。通过对 JMX 使用不同的端口来解决。

回答by jsaddwater

In my case I got disconnected from the JBoss instance that I had started in IDEA, and the server continued to run, thus using the 1099 port for JMX.

在我的例子中,我与我在 IDEA 中启动的 JBoss 实例断开了连接,服务器继续运行,因此将 1099 端口用于 JMX。

You can either kill the server process using that port (it'll be a java process using a lot of memory) or create a remote debug configuration that you can use in case you don't want to restart the server. Use the same debug ports for the local and remote debug configurations.

您可以使用该端口终止服务器进程(它将是一个使用大量内存的 java 进程),或者创建一个远程调试配置,以防您不想重新启动服务器。对本地和远程调试配置使用相同的调试端口。

回答by Oubenal Mohcine

make sure you have localhost defined in your /etc/hostsfile, and that it's defined only once

确保在/etc/hosts文件中定义了 localhost ,并且只定义了一次

localhost         127.0.0.1

it was leaving the maven process in intelliJ hanging which caused the port 1099 already in useerror even after changing the jmx port to something different.

它将 maven 进程留在 intelliJ 挂起中,port 1099 already in use即使在将 jmx 端口更改为不同的端口后也会导致错误。

回答by Neelima

Go to terminal and kill the session

转到终端并终止会话

ps -aef | grep 1099
kill -9 PID

回答by Dulith De Costa

Since it is easy to tackle with Terminal. Open the Terminal and type following.

由于使用Terminal很容易解决。打开终端并输入以下内容。

fuser 1099/tcp

If a process uses above port, it should return something output like this.

如果一个进程使用上面的端口,它应该返回这样的输出。

1099/tcp:            2222

The last column value (2222) is referred to the Process ID (PID).

最后一列值 (2222) 指的是进程 ID ( PID)。

Just KILLit as follows.

只需按如下方式杀死它。

kill -9 2222

Now you can start debugging.

现在可以开始调试了。

回答by Shashank Bodkhe

on windows :

在窗户上:

step 1] find the process : netstat -ano or netstat -aon |find /i "listening" |find "Port no"

步骤 1] 找到进程:netstat -ano 或 netstat -aon |find /i "listening" |find "Port no"

step 2] kill the process : Taskkill /F /IM (Process id obtained from above step)

步骤 2] 终止进程:Taskkill /F /IM(从上述步骤中获得的进程 ID)

Please see example below:

请看下面的例子:

enter image description here

在此处输入图片说明