Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Eclipse Debugging Plugin JIRA 4.2

Luis Mayora
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.
June 28, 2011

I already set up my development environment but i am unable to debug my plugins and use the Eclipse breakpoints. I have followed this process.

1. Stop using JIRA as a service.
2. Setting the correct environment variables. (I included the bat file provided on this forums.)
3. Start Tomcat using Debug Mode(See Image)
4. Create a Debug Configuration in Eclipse to point to Remote Server PORT.
5. I got the error message: Failed to connect to remote VM. Connection refused. Connection refused: connect

May be I am doing something wrong.

  • But how eclipse moves the JAR Plugin to the JIRA Installed Plugins Folder (Do i need to do something else in Eclipse?)
  • Do I have to use atlas-debug with this approach(I'm using a JIRA standalone installation so I think i don't have to start the bundled tomcat)
  • I have tested the plugin and it works perfectly.(No debugging yet)
  • Environment(JIRA 4.2,Plugin-sdk-3.2.3, Eclipse Helios J2EE, Windows XP)

Thank you.



http://forums.atlassian.com/servlet/JiveServlet/download/46-55016-257379588-76854/mystartup.bat.txt


4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
m
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.
May 11, 2012

Louis,

I'm curious if you ever got this running. Did you? I'm in the process of updating the documentation regarding JIRA debug sessions. This is what I've discovered:

  • you should start the plugin project with atlas-debug so that it opens the debug port
  • the default debug port is 5005 you can change this with a command parameter

Regards,

Mary

Luis Mayora
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.
October 9, 2012

It got resolved but never got the emails untils now.

2 votes
Andy Brook [Plugin People]
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.
June 29, 2011

Hello,

Answering the question about 'how it works', when you initiate a debug connection to Jira from Eclipse, Eclipse intercepts requests by the Jira VM for classes and lets you use Eclipse to step through their execution (for example, get the Jira Source zip, and add to your 'source' path, it may take a while, but atlassian code will be magically found, allowing you to see whats going on). Because of this interception, no jars need to be moved/copied. Things get a little confused sometimes when you do hot code edits during a debug run, sometimes the call stack unwinds to a previous level, allow a repeat execution, sometimes thing get 'out of sync' and debugging session needs to be restarted, or even have jira restarted as well.

The screenshot you show is indicating its listening on 8000, are you connecting to localhost on the same machine in the Eclipse Remote Debug Target?

I have a bunch of Jira debug sessions at the moment, and all use the following syntax:

JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"

Im not sure what Atlassian have done to break down 'simplify' the settings but this should work:

SET JAVA_OPTS="%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"

Try using 'telnet 8000' at a command prompt and see if it connects. If not, perhaps you have a software firewall in the way? check firewall logs?

Luis Mayora
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.
June 29, 2011

Are you using a customized jira startup.bat. I have started my instance from cmd using the arguments you provided. But when i did the telnet localhost 8000 i did the following message.

Debugger failed to attach: timeout during handshake

When eclipse fails when attaching the debugger.

Could you provide your settings to enable debugging?

0 votes
Luis Mayora
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.
June 29, 2011

Yes Indeed. I have created a Remote Debug Target using localhost and port 8000. But I do have the same error. I have started jira like this.

mystartup.bat -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

Firewall is disabled since im using a vmware vm.

telnet from a cmd:

telnet localhost 8000.

Jira start up command prompt the following message.

Debugger failed to attach: timeout during handshake

So the tomcat is listening definitely, but for some reason eclipse cant attach the debugger.

Are you using a customized startup.bat or using the same jira installation one.

0 votes
Colin Goudie
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.
June 29, 2011

Can you show us your eclipse configuration to ensure it is set to connect on port 8000?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events