Solved

Debug mode to show runtime errors using catalina debug?

Posted on 2003-12-09
6
1,196 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
[X]
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
6 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9904799
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
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..

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
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.

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
jimmack earned 50 total points
ID: 9905042
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
ID: 10141132
;-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Make the most of your online learning experience.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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