Java 与目标 VM 断开连接,地址:'127.0.0.1:51928',传输:'socket'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48155191/
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-12 02:46:30  来源:igfitidea点击:

Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

javasocketsintellij-ideabigdecimal

提问by Danpatpang

what's mean "Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'"? I'm korean and visit Myanmar. So, I test this code`

“与目标虚拟机断开连接,地址:'127.0.0.1:51928',传输:'socket'”是什么意思?我是韩国人和访问缅甸。所以,我测试这段代码`

import java.math.BigDecimal;
public class puzzle2 {
    public static void main(String args[]){
        System.out.println(2.00-1.10);  //0.8999999999999999
        System.out.println(new BigDecimal("2.00").subtract(new BigDecimal("1.10")));    //0.10
    }
}

result is

结果是

Connected to the target VM, address: '127.0.0.1:51928', transport: 'socket'

0.8999999999999999

0.90

Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

连接到目标VM,地址:'127.0.0.1:51928',传输:'socket'

0.8999999999999999

0.90

与目标 VM 断开连接,地址:'127.0.0.1:51928',传输:'socket'

what's mean that?

那是什么意思?

采纳答案by Kedar Joshi

Java debugger prints the following message when it is connected to debugging port of JVM.

Java 调试器在连接到 JVM 的调试端口时会打印以下消息。

Connected to the target VM, address: '127.0.0.1:51928', transport: 'socket'

Connected to the target VM, address: '127.0.0.1:51928', transport: 'socket'

Similarly when your program terminates following message is printed to indicate that debugger has disconnected from the port.

同样,当您的程序终止时,将打印以下消息以指示调试器已从端口断开连接。

Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

Disconnected from the target VM, address: '127.0.0.1:51928', transport: 'socket'

Since these logs are written at the same time, console mixes them up.

由于这些日志是同时写入的,因此控制台将它们混在一起。

回答by serdroid

When you started your java program in debug mode, your IDE starts the JVM in debug mode (listening a socket to attach debugger). The statement starting with 'Connected ... ' shows your IDE connected to your debugging program, and 'Disconnected ...' shows your IDE disconnected from JVM because of your program is terminated.

当您以调试模式启动 Java 程序时,IDE 以调试模式启动 JVM(侦听套接字以连接调试器)。以 'Connected ... ' 开头的语句显示您的 IDE 已连接到您的调试程序,而 'Disconnected ...' 显示您的 IDE 由于您的程序已终止而与 JVM 断开连接。

回答by John

I had similar problem with libGDX. It might have been related to my upgrade from 2017 to 2018 versions of IntelliJ. But it suddenly stopped working again, after I'd just recreated the project using the 2018 version to import a barebone libgdx project.

我对 libGDX 有类似的问题。这可能与我从 2017 年到 2018 年版本的 IntelliJ 升级有关。但是在我刚刚使用 2018 版本重新创建项目以导入准系统 libgdx 项目之后,它突然再次停止工作。

This might need a new question but I'm lazy so will piggyback my answer here.

这可能需要一个新问题,但我很懒,所以将在这里附上我的答案。

As others point out, it is a debugging issue. (I don't actually understand what the OP of this question is asking, but the error looks right) I tried running without debugging and it fired up my previous version. "What good is code I can't change?" So I hit debug and sure enough I'm back on my new code's breakpoint.

正如其他人指出的那样,这是一个调试问题。(我实际上不明白这个问题的 OP 在问什么,但错误看起来是正确的)我尝试在没有调试的情况下运行,它启动了我以前的版本。“我无法更改的代码有什么好处?” 所以我点击了调试,果然我回到了我的新代码的断点上。

回答by ismael

change port

更改端口

server:
    port: 8083

Change the previous port to an open port :)

将之前的端口更改为开放端口:)

回答by Shivam Patidar

The problem is that your console is hidden, perhaps meaning that a widget isn't being shown. You can see these errors in [the] Variables [widget]. So when you open the variables widget, the column on the right side will show you the frames, thread, [and the stack calls]. This is the best place to inspect console output. Just click on it and rerun the debug mode and use this to troubleshoot your transport socket error.

问题是您的控制台是隐藏的,这可能意味着没有显示小部件。您可以在 [the] Variables [widget] 中看到这些错误。因此,当您打开变量小部件时,右侧的列将显示框架、线程和 [和堆栈调用]。这是检查控制台输出的最佳位置。只需单击它并重新运行调试模式并使用它来解决您的传输套接字错误。

回答by Sandun Susantha

The main method should be called the object of inherited method. Otherwise you can get the following error when you are debugging the class:

main方法应该被称为继承方法的对象。否则,在调试类时可能会出现以下错误:

Connected to the target VM, address: '127.0.0.1:60102', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:60102', transport: 'socket'