• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Debugging a servlet program

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..............
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic