Remote debug confluence with eclipse

Hi,

i added the following confliguration in my setenv.sh =>

-Xdebug -agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n

i see in my logs the following line =>

Listening for transport dt_socket at address: 1043

So I suppose that I normally can connect on the port 1043 with my eclipse, but i doesnt work...

I have no probleme to remote debug on a windows server, but hier it's a linux and it fail...

What's the difference? and what I'm missing?

Thanks.

François


1 answer

1 accepted

François, have a try in it!

 

Step 1 - Edit catalina.bat:

Go to your atlassian-jira-x.x.x-standalone/bin and open catalina.bat in an editor.

Find the following chunk of code:

 

1
2
3
4
5
6
rem set _EXECJAVA=%_RUNJAVA%
rem set MAINCLASS=org.apache.catalina.startup.Bootstrap
rem set ACTION=start
rem set SECURITY_POLICY_FILE=
rem set DEBUG_OPTS=
rem set JPDA=

 

 

and replace it with:

 

1
2
3
4
5
6
set _EXECJAVA=%_RUNJAVA%
set MAINCLASS=org.apache.catalina.startup.Bootstrap
set ACTION=start
set SECURITY_POLICY_FILE=
set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=7456,server=y,suspend=n
set JPDA=

 

 

Notice that address=7456 means that this port will be available for debugging. You can use any other port you want.

 

Step 2 - Add external run configuration in Eclipse

  • Go to Run -> Debug Configurations...
  • Create a new Remote Java Application run configuration: (right click Remote Java Application -> New)
  • Make sure your Project: option is set to your Jira plugin project.
  • Set your Connection Type: to Standard (Socket Attach).
  • Under Connection Properties, put in your host (in my case localhost ), then specify your port. (in my case 7456)

 

Now you have your debugging mechanism all set up. After you start jira, just run this debugging configuration (Debug As -> Debug Configurations -> Your configuration) and place your breakpoints wherever you need them.

 

Cheers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

1,032 views 23 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you