eclipse-archived / codewind

The official repository of the Eclipse Codewind project
https://codewind.dev
Eclipse Public License 2.0
113 stars 45 forks source link

ClosedConnectionException when trying to debug certain Appsody templates in VSCode Windows #300

Closed naveenkaratekid closed 4 years ago

naveenkaratekid commented 5 years ago

Codewind version: 0.3.0 OS: Windows 10 IDE version:1.37.1

Description: Error being thrown when I attempt to debug any of the following Appsody templates:

Whenever I try to debug any of the templates I listed above, after a few moments, I get a popup that says

"Failed to attach to remote debuggee VM. Reason: com.jdi.spi.ClosedConnectionException

VSCode debug failed ClosedConnectionException

Steps to reproduce:

  1. Create a project from one of the Appsody templates mentioned above
  2. Once it's created, right click the project, and then select "Restart in Debug Mode"

launch.json @jagraj

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Appsody: Attach java debugger",
            "type": "java",
            "request": "attach",
            "hostName": "localhost",
            "port": 5005
        }
    ]
}
keithchong commented 5 years ago

This appears to be a dup of https://github.com/eclipse/codewind/issues/239

keithchong commented 5 years ago

After you see the message, run the Attach Debugger action manually.

sghung commented 5 years ago

@naveenkaratekid the documentation can be found via: https://github.com/eclipse/codewind-docs/blob/master/docs/_documentations/troubleshooting.md#appsody-with-codewind

naveenkaratekid commented 5 years ago

@keithchong Once I saw the error message, I performed the workaround as you suggested.

After I restarted the project in Debug mode, I right clicked on the project, and then selected Attach Debugger, and I got a similar error message but with a different reason: Failed to attach remote debuggee VM. Reason: java.net.ConnectException: Connection refused: connect

failed to attach remote debugee when manually attaching debugger

keithchong commented 5 years ago

Run the attach debugger command again. If the issue persists after a few attempts, restart the project in Debug mode a second time.

naveenkaratekid commented 5 years ago

After verifying the issue in Mac and Windows, myself, @DavidG1011, and @sujeilyfonseca got the issue fixed using the workaround that was provided to us. In Windows, there is a different workaround we discovered: start by entering debug mode. Let the process finish, and expect it to fail (already documented that it will fail the first time). Wait for the restart notification on the bottom bar to fade away. Then, manually set the debugger.

@sishida

makandre commented 4 years ago

Can this be closed?

naveenkaratekid commented 4 years ago

Yes.