Solved

Debug mode to show runtime errors using catalina debug?

Posted on 2003-12-09
6
1,192 Views
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?
0
Comment
Question by:lodelode
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
Do you mean you want to set the Logger up to give you more information (inside your <Context>) ?

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/logger.html
0
 

Author Comment

by:lodelode
Comment Utility
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..

egs

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?
0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
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.

http://archives.real-time.com/pipermail/tomcat-users/2003-January/091734.html

Maybe kennethxu might know (he's bound to have a look at this question before long ;-))
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:lodelode
Comment Utility
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
0
 
LVL 15

Accepted Solution

by:
jimmack earned 50 total points
Comment Utility
I've never used anything like this myself, however, according to a very brief scan through this article:

http://www.fawcette.com/javapro/2003_06/online/debugging_kjones_06_23_03/default_pf.aspx

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:

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%22catalina+jpda+start%22&btnG=Google+Search
0
 
LVL 15

Expert Comment

by:jimmack
Comment Utility
;-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now