It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Eclipse Debugging Plugin JIRA 4.2

Luis Mayora Jun 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

0 votes
Answer accepted
manthony 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 Oct 09, 2012

It got resolved but never got the emails untils now.

2 votes
Andy Brook (DEV) Jun 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 Jun 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
Colin Goudie Jun 29, 2011

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

0 votes
Luis Mayora Jun 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.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in United States

Unofficial downtown meetup week of June 3 or 4?

Hello everyone!  It's been a while since Houston's had a Atlassian Community Event (formerly Atlassian User Group meeting) so I wanted to gauge interest in an unofficial downtown meetup after wo...

12 views 0 0
View post

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you