javaVSCode icon indicating copy to clipboard operation
javaVSCode copied to clipboard

Can't get remote debugger to connect

Open mvanveen82 opened this issue 7 years ago • 2 comments

Hi,

I have a springboot java backend to which I'm trying to connect with the debugger. When starting the debugger the debugger controls appear at the top of the screen but only the stop en retry buttons are active. And the nightrider style loader under de debug configuration keeps flashing. So it seems it tries to connect but can't. However I get no error. Also the console of the springboot app show nothing. Only when stopping the debugger it reprints "Listening for transport dt_socket at address: 5005"

setting in pom.xml for debugging

<plugin>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-maven-plugin</artifactId>
        <version>${project.parent.version}</version>
        <dependencies>
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>springloaded</artifactId>
                  <version>1.2.6.RELEASE</version>
             </dependency>
        </dependencies>
	<configuration>
           <jvmArguments>
	     -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
	   </jvmArguments>
	</configuration>
</plugin>

task (tasks.json) with which I launch the springboot app:

{
	"version": "0.1.0",
	"command": "mvn",
	"isShellCommand": true,
	"showOutput": "silent",
	"args": [
	],
	"tasks": [
		{
			"taskName": "Spring Boot Run",
			"suppressTaskName": true,
			"args": [
				"spring-boot:run"
			],
			"showOutput": "always"
		}
	]
}

Lauch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Java remote debugging",
            "type": "java",
            "request": "attach",
            "remoteHost": "localhost",
            "remotePort": 5005,
            "cwd": "${workspaceRoot}",
            "jdkPath": "/usr/local/var/jenv/shims",
            "startupClass": "${workspaceRoot}/target/classes/nl/bereslim/BsmBackendApplication",
            "options": [
                "-classpath",
                "${workspaceRoot}"
            ]
        }
    ]
}

mvanveen82 avatar May 05 '17 08:05 mvanveen82

I think you need to change your "startupClass" and add "sourcepath". You can try to hack your launch configuration since it extension still lacks of some documentation.

faustinoaq avatar Jun 10 '17 16:06 faustinoaq

Hmm, seems to be same problem as https://github.com/DonJayamanne/javaVSCode/pull/56 I've seen the same effect while trying to attach to a multithreaded local process.

dueckminor avatar Jul 20 '17 21:07 dueckminor