malini
(malini kennady)
November 27, 2017, 5:24am
1
I am new to Gradle. I am using Buildship in eclipse. My build.gradle looks like,
gretty {
httpPort = 8080
contextPath = '/'
servletContainer = 'jetty9'
}
When I debug the application as, ‘gretty -> appStartDebug’, the console waits saying like,
Listening for transport dt_socket at address: 5005
My project is a web application with init as,
@WebServlet(urlPatterns="/InitServlet", loadOnStartup=0)
public class InitServlet extends HttpServlet {
}
public static void initialize() {
system.out.println("Initializing");
}
I have my break point in the sysout. Is this proper way of debugging gradle application?
jjustinic
(James Justinic)
November 27, 2017, 7:00am
2
malini:
When I debug the application as, ‘gretty -> appStartDebug’, the console waits saying like,
Listening for transport dt_socket at address: 5005
This is normal Java debugging behavior with suspend=y
, unrelated to Gradle or Buildship. You need to configure your IDE remote debugger to attach to localhost:5005
before the application will continue to run normally.
malini
(malini kennady)
November 27, 2017, 9:16am
3
Let me just clarify the steps I followed in eclipse,
Create new debug configuration ‘Remote Java Application’ with Host: localhost, port = 5005
Debug as ‘appRunDebug’
Run remote debugger.
Error throws:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
Are these steps right?
What about the value,
set GRADLE_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n ?
Should I need it anyway?
malini
(malini kennady)
November 27, 2017, 9:41am
4
Following the above steps works fine. 'Connection refused: connect'
is resolved.