|[RESOLVED]Attaching a web server (TomCat7) to debug java source code [message #1452778]
|Sat, 25 October 2014 22:26
| Jim Anderson
Registered: October 2014
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?
[Updated on: Tue, 28 October 2014 02:04]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02530 seconds