Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [RESOLVED]Attaching a web server (TomCat7) to debug java source code(I have a bug in my source code for a web site and I need to see exactly where the failure is)
[RESOLVED]Attaching a web server (TomCat7) to debug java source code [message #1452778] Sat, 25 October 2014 22:26 Go to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
Let me give a brief explanation of what I am doing and what my environment is.

I am developing a web site that I hope to make available on the internet someday. I am writing the code in java, JSP, HTML. Virtually all the client code is written in JSP and HTML and the server side code is predominantly java source code.

For my development environment, I am using Firefox, Apache Tomcat 7, java 1.8. For the past several months, I have made steady progress by using the Firefox console and some of my own debugging code to follow the logic in the server side source code.

BUT - I have run into a bug which defies my ability to figure out what is going wrong. My code is giving me a stacktrace where there is a null pointer. It is pretty obvious then some of my upstream code, which is supposed to produce an object with a valid pointer, is not working. It looks to me that if the code is failing, it would have to be due to an exception being thrown. However, in my 'try .... catch' code, the 'catch' code never gets hit, at least as far as I can tell. Using my own debugging code, I can verify that the likely culprit method is entered, but there is never a return from that method (in the 'try' part of the code). For the life of me, I can not figure out where things are going astray. I need to be able to view the java execution in detail and see where in the method the failure is.

I have begun reading some documentation about attaching processes to Eclipse, but I am not finding what I am looking for. To be honest, much of the documentation does not really make sense to me. I used to work with a SunMicrosytems debugger (for C/C++ code), and the methodology was this:

1) compile the program with the debug option
2) run the C program
3) using Unix 'ps', get the process id of the C-program
4) run the debugger
5) attach the process using the id from step 3.
6) set break points in the compiled code (it has been a while, but I don't
remember the exact sequence for stopping the program at the break
points, but it was not too complicated.

My question, is there a document that describes a methodology similar to what I have just described so that I can use Eclipse to debug my server side source java code?

Jim A.

[Updated on: Tue, 28 October 2014 02:04]

Report message to a moderator

Re: Attaching a web server (TomCat7) to debug java source code [message #1453657 is a reply to message #1452778] Mon, 27 October 2014 09:20 Go to previous messageGo to next message
Sarika Sinha is currently offline Sarika SinhaFriend
Messages: 131
Registered: February 2010
Location: Bangalore, India
Senior Member
Please refer to the detailed hep document of eclipse Java Debugger.

http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-running_and_debugging.htm&cp=1_3_6


Sarika Sinha
JDT Programmer
Re: Attaching a web server (TomCat7) to debug java source code [message #1453836 is a reply to message #1453657] Mon, 27 October 2014 15:22 Go to previous message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
Sarika, thank you for the pointer. This is what I was looking for. I'm not sure why I did not find it, but I did find a few tutorials/blogs in the internet that were similiar.

Jim
Previous Topic:crash file->new->java project
Next Topic:ADT: Returned exit code 13
Goto Forum:
  


Current Time: Sat Apr 27 03:13:21 GMT 2024

Powered by FUDForum. Page generated in 0.03044 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top