provegard / ncdbg

A debugger for Nashorn that uses Chrome DevTools as frontend
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

java.io.IOException: handshake failed - connection prematurally closed #103

Closed hugsyy closed 5 years ago

hugsyy commented 5 years ago

Hello, I am probably doing something wrong while connecting ncdbg to my Spring Boot app. I get the app running on localhost:8080. Then, I run ncdbg --connect localhost:8080 on CMD. Here's the output:

NCDbg version: 0.8.3
NCDbg built with Java version: 1.8
Local Java version: 1.8.0_192
Connecting to localhost:8080...
Failed to start the debugger
java.io.IOException: handshake failed - connection prematurally closed
        at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:136)
        at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
        at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
        at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
        at com.programmaticallyspeaking.ncd.nashorn.Connections$.connect(Connections.scala:23)
        at com.programmaticallyspeaking.ncd.nashorn.Connections$.connect(Connections.scala:9)
        at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerConnector.connect(NashornDebugger.scala:26)
        at com.programmaticallyspeaking.ncd.nashorn.NashornDebuggerConnector.$anonfun$connect$1(NashornDebugger.scala:18)
        at java.lang.Thread.run(Thread.java:748)

Could you please help? Thanks

provegard commented 5 years ago

How do you start your Spring Boot app? Specifically, which VM arguments do you pass?

See this for reference: https://github.com/provegard/ncdbg/blob/master/docs/README.md#the-debug-target

hugsyy commented 5 years ago

I successfully connected ncdbg. Thanks a lot!:)

provegard commented 5 years ago

Good to hear, no problem!