File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging a servlet program

 
anirudh takkallapally
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet invoked from an applet , i am trying to debug this servlet program , the communication between the applet and servlet is fine , in the servlet i am trying to create a file ..., which it is not doing ,
basically i would like to know how to view the exceptions that are thrown by the system , i am able to view these exceptions on a tomcat terminal window which comes when i start the server on my standalone windows machine , but there is no terminal window comming on unix machine where i am trying to run the program ,
is there a way to view the exceptions that are generated by the system and how do i view them???
please help
thx..............
 
Tom Blough
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use try/catch blocks in your servlet code and return the error description to the client browser. The exceptions are going to the server because you are not catching them.
 
Michael Bronshteyn
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To debug servlet you need remote debugging capability. You can use jdb or get some java debuggers which will allow you to do so. Then you need to start your servlet container in the debug mode and attach your debugger to the servlet container. After that you can set breakpoint in your servlet code and debug as normal.
 
Brian Pipa
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use one of the many logging APIs and have it write to a file. You can then view the file to see what's happening. You can even setup a JSP or servlet so that you can view that file remotely froim a browser
brian
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic