Solved

Debug mode to show runtime errors using catalina debug?

Posted on 2003-12-09
6
1,195 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
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
Independent Software Vendors: 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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