Debug mode to show runtime errors using catalina debug?

Posted on 2003-12-09
Medium Priority
Last Modified: 2008-02-26
Hi experts, this is a rather simple question i  guess, but i need some help on this as i'm a newbie to tomcat and jsp in general.

Currently i am running tomcat 4.0.6. All i do is start it up and i get

Apache Tomcat/4.0.6
Starting service Tomcat-Apache
Apache Tomcat/4.0.6

I understand theres a way i can load up tomcat in a debug mode which should show errors/activities when my jsp code is being processed. I've been taught using

catalina jpda start or
catalina debug >> followed by "run"

to enter debug mode
however, these two commands dont seem to have any effect on my tomcat console. is there anything wrong?
Question by:lodelode
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 15

Expert Comment

ID: 9904799
Do you mean you want to set the Logger up to give you more information (inside your <Context>) ?


Author Comment

ID: 9904849
i'm looking for something like a jboss console where all the processing activities are shown.

pardon my lack of knowledge with regards to the Logger you have provided, it seems a little high end for me.

to put things short, i would want what is stored in my log files to be directly shown in the tomcat console..


Files\Apache Tomcat 4.0\webapps\webdav
2003-12-09 23:13:02 WebappLoader[/webdav]: Deploying class repositories to work directory C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\webdav
2003-12-09 23:13:02 StandardManager[/webdav]: Seeding random number generator class java.security.SecureRandom
2003-12-09 23:13:02 StandardManager[/webdav]: Seeding of random number generator has been completed
2003-12-09 23:13:03 ContextConfig[/webdav]: Added certificates -> request attribute Valve
2003-12-09 23:13:03 StandardWrapper[/webdav:default]: Loading container servlet default
2003-12-09 23:13:03 StandardWrapper[/webdav:invoker]: Loading container servlet invoker
2003-12-09 23:13:11 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.servlet.ServletException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect
      at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
      at org.apache.jsp.TMP7kzpwpmvjy$jsp._jspService(TMP7kzpwpmvjy$jsp.java:90)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
      at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:1622)
      at com.mysql.jdbc.Connection.<init>(Connection.java:491)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:171)
      at org.apache.jsp.TMP7kzpwpmvjy$jsp._jspService(TMP7kzpwpmvjy$jsp.java:61)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

instead of having to constantly look at the log file to see what happened, i'd like to debug the error by viewing it from the tomcat console itself. any suggestions?
LVL 15

Expert Comment

ID: 9904914
Hmm.  Tricky one.  Since I use Linux, I would do the following:

tail -f /var/tomcat4/logs/catalina.out

This displays the end of the file (tail) and each time something is added, this is also displayed (-f).  You may be able to do this under Windows with something called cygwin, but I'm not sure how.


Maybe kennethxu might know (he's bound to have a look at this question before long ;-))

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 9904949
thanks tho.

just wondering if u're sure of what

catalina jpda start

does? i was told it would engage in some debug mode. but nothing changes in my tomcat console
LVL 15

Accepted Solution

jimmack earned 200 total points
ID: 9905042
I've never used anything like this myself, however, according to a very brief scan through this article:


It seems that the start line that you are using allows a remote debugger to be used for the servlet container.

It doesn't seem to have anything to do with output to a console.

There are some other articles about it on google.  You might have some luck if you check through some of them:

LVL 15

Expert Comment

ID: 10141132

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question