Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger doesn't work on IntelliJ #36

Closed
mrichardsonjr opened this issue Jul 11, 2014 · 11 comments

Comments

Projects
None yet
5 participants
@mrichardsonjr
Copy link

commented Jul 11, 2014

I read the documentation here (http://akhikhl.github.io/gretty-doc/Debugger-support.html) about using the debugger. I'm using IntelliJ IDEA, but I can't get the debugger to work. I've tried using the debugger from both the command line and the gradle plugin, and I've tried both the jettyStartDebug and jettyRunDebug tasks. I also tried using the jettyStart task with the IntelliJ debug icon, but that didn't work either.

@akhikhl

This comment has been minimized.

Copy link
Owner

commented Jul 12, 2014

OK, I'll read documentation on debugging java processes under ItelliJ IDEA and find out, how to make it working.

@akhikhl akhikhl self-assigned this Jul 12, 2014

@akhikhl

This comment has been minimized.

Copy link
Owner

commented Jul 17, 2014

I managed to make debugging work with IntelliJ IDEA and Gretty. Here is know-how (will be included in documentation):

Import web-application into IntelliJ IDEA

  1. Add apply plugin: 'org.akhikhl.gretty' to your project.
  2. Import project into IntelliJ IDEA. Make sure you select "Import project from external model", "Gradle" in "Import Project" dialog.

Prepare "Remote Debug" configuration

  1. Select menu "Run/Edit Configurations".

    Check: "Run/Debug Configurations" dialog pops up.
  2. Click on "+" icon, select "Remote" from the list.

    Check: new configuration with name "Unnamed" appears under "Remote" category.
  3. Change configuration name to something more sensible, like "Remote Debug".
  4. Don't change any other parameters, just click "OK".

Run web-application under the debugger

  1. Start gradle task "appStartDebug" under IntelliJ IDEA.

    Attention: do not try to start this task under the debugger. Run it in normal mode.

    Check: you should see "Listening for transport dt_socket at address: 5005" in "Run" output window.
  2. Select menu "Run/Run...", select "Remote Debug" configuration, select "Debug" command.

    Check: you should see "Connected to the target VM, address: 'localhost:5005', transport: 'socket'" in "Debug" output window.

    Check: you should see "Run 'gradle appStop' to stop the server." in "Run" output window.

Now your web-application is running under the debugger: you can set breakpoints, watch/inspect variables etc.etc.

@akhikhl

This comment has been minimized.

Copy link
Owner

commented Jul 17, 2014

Important: you should stop debugged web-application via gradle task "appStop". Otherwise there will be process hanging.

@akhikhl akhikhl added the resolved label Jul 29, 2014

@akhikhl

This comment has been minimized.

Copy link
Owner

commented Aug 27, 2014

Did you manage to make debugging work under IntelliJ IDEA? Can I close this issue?

@mrichardsonjr

This comment has been minimized.

Copy link
Author

commented Aug 28, 2014

This is working for me. Thanks very much!

@MrYang

This comment has been minimized.

Copy link

commented Jan 1, 2016

thanks very mush

@mohamnag

This comment has been minimized.

Copy link

commented Apr 21, 2016

I had the same problem with debugging and even though I could make the debugging work but I have to say this is really the strangest setup I have seen using intellij debugging a local process.

even the official outdated gradle jetty plugin can be started easily in debug mode and inetllij picks up the debug connection. I'm not a gradle plugin profi but I'm using intellij for a good 2 years now and this is not really easy and preferred way of debugging in intellij.

could you please keep this issue open until solution gets as easy as original gradle jetty plugin?

@saladinkzn

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2016

it can't be easy cuz currently gretty has two running java apps: main
(containgin gradle plugin, scanner etc) and Runner app that contains only
application server an you web application.

2016-04-21 22:21 GMT+03:00 Mohammad Naghavi notifications@github.com:

I had the same problem with debugging and even though I could make the
debugging work but I have to say this is really the strangest setup I have
seen using intellij debugging a local process.

even the official outdated gradle jetty plugin can be started easily in
debug mode and inetllij picks up the debug connection. I'm not a gradle
plugin profi but I'm using intellij for a good 2 years now and this is not
really easy and preferred way of debugging in intellij.

could you please keep this issue open until solution gets as easy as
original gradle jetty plugin?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#36 (comment)

@saladinkzn

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2016

The only way to debug is have a remote debugging

2016-04-21 22:51 GMT+03:00 Тимур Шакуров saladinkzn@gmail.com:

it can't be easy cuz currently gretty has two running java apps: main
(containgin gradle plugin, scanner etc) and Runner app that contains only
application server an you web application.

2016-04-21 22:21 GMT+03:00 Mohammad Naghavi notifications@github.com:

I had the same problem with debugging and even though I could make the
debugging work but I have to say this is really the strangest setup I have
seen using intellij debugging a local process.

even the official outdated gradle jetty plugin can be started easily in
debug mode and inetllij picks up the debug connection. I'm not a gradle
plugin profi but I'm using intellij for a good 2 years now and this is not
really easy and preferred way of debugging in intellij.

could you please keep this issue open until solution gets as easy as
original gradle jetty plugin?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#36 (comment)

@mohamnag

This comment has been minimized.

Copy link

commented Apr 22, 2016

mmm ... thats actually interesting because integration test tasks work with IDEA's debugging seamlessly. maybe they have other structure.

@mohamnag

This comment has been minimized.

Copy link

commented Apr 28, 2016

I have to take my last comment back, the integration tests work only if you want to debug the test itself. debugging the code on server side is impossible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.