Remote debug confluence with eclipse

François September 2, 2016

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

0 votes
Answer accepted
crochaju
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2016

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
TAGS
AUG Leaders

Atlassian Community Events