简体   繁体   English

IntelliJ Idea IDE 使用端口 1099

[英]IntelliJ Idea IDE using port 1099

I'm using IntelliJ Idea Community Edition IDE and I'm trying to run a Maven WebApp with Jetty by command line.我正在使用 IntelliJ Idea Community Edition IDE,我正在尝试通过命令行使用 Jetty 运行 Maven WebApp。 I'm on a RedHat box我在 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.有趣的是,当我关闭 IntelliJ Idea 时,1099 端口被释放了。 I can't find the reason why and how Idea is using this port.我找不到 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(我猜想强迫它选择另一个端口)

I am sure IntelliJ Idea does not use 1099 port internally.我确信 IntelliJ Idea 不会在内部使用 1099 端口。 I have used this PORT for Tomcat.我已将此端口用于 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.例如: lsof -w -n -i tcp:8080会给我在我的 linux 机器上的8080上运行的应用程序。

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"步骤 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:请看下面的例子:

在此处输入图片说明

On my Mac a process called "fsnotifier" is using port 1099. A google on this indicates that it's an IntelliJ file system watcher.在我的 Mac 上,一个名为“fsnotifier”的进程正在使用端口 1099。谷歌对此表示它是一个 IntelliJ 文件系统观察程序。 Solved by using a different port for JMX.通过对 JMX 使用不同的端口来解决。

make sure you have localhost defined in your /etc/hosts file, 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 use error even after changing the jmx port to something different.它使 maven 进程处于 intelliJ 挂起状态,即使将 jmx 端口更改为不同的端口,也会导致port 1099 already in use错误。

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.您可以使用该端口终止服务器进程(它将是一个使用大量内存的 java 进程),或者创建一个远程调试配置,以防您不想重新启动服务器。 Use the same debug ports for the local and remote debug configurations.对本地和远程调试配置使用相同的调试端口。

Since it is easy to tackle with Terminal .由于使用Terminal很容易解决。 Open the Terminal and type following.打开终端并输入以下内容。

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 KILL it as follows.只需按如下方式杀死它。

kill -9 2222

Now you can start debugging.现在可以开始调试了。

On windows command line:在 windows 命令行:

1. find which process uses port 1099 1.查找哪个进程占用了1099端口

netstat -ano -p tcp |find "1099"

在此处输入图像描述

2. Process with PID 2112 is listening on port 1099. Now we can query task list to find the process. 2. PID 为2112 的进程正在监听1099 端口。现在我们可以查询任务列表来找到该进程。

tasklist |find "2112"

在此处输入图像描述

Also You can check the windows task manager.您也可以检查 windows 任务管理器。 在此处输入图像描述

3. Kill the process from task manager, by right click on the item and selecting End task or via command line: 3.从任务管理器中终止进程,右键单击该项目并选择结束任务或通过命令行:
taskkill /F /PID 2112

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM