You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Trenton D. Adams" <tr...@telusplanet.net> on 2002/06/12 19:12:26 UTC

Debugging

Where could I get information on debugging a web application under
tomcat?  Is there a way of doing it or do you have to just do a whole
bunch of printing to the tomcat screen or web page?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Debugging

Posted by Jeff Larsen <la...@qec.com>.
I develop with JBuilder 4 Pro which has support for Tomcat 3, but
not Tomcat 4. So I did a little digging and discovered the class
org.apache.catalina.startup.Embedded. Download the source and look
at the main() method in this class. It will show you how to use the
Embedded class to run Tomcat from within another class. I wrote
my own TomcatRunner class which employs the Embedded class to run
Tomcat 4.0.3 much in the same way as Embedded.main() except customized
for my application. All you need to do is put
TOMCAT_HOME/bin/bootstrap.jar
and TOMCAT_HOME/server/lib/catalina.jar in your classpath. Then just
run
your enclosing class in your debugger. It beats the heck out of trying
to
customize my IDE to use TC4.

Jeff

----- Original Message -----
From: "Trenton D. Adams" <tr...@telusplanet.net>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, June 12, 2002 12:12 PM
Subject: Debugging


> Where could I get information on debugging a web application under
> tomcat?  Is there a way of doing it or do you have to just do a
whole
> bunch of printing to the tomcat screen or web page?
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Debugging

Posted by Rick R <to...@yahoo.com>.
--- Ravishankar S <ra...@ionidea.com> wrote:
> yes..i have also used Forte for Java Comm
> edition...v2 is ok...v 3 is a
> little too heavy....hangs a lot...anyway with win98
> it's like
> asking a horse to tow a battletank:-)))
> 
> on linux it's a totally different story which i
> don't want to discuss.....

Try Netbeans. I couldn't run Forte on Linux, but I
could get Netbeans to run. go figure.

Also, you mentioned using a DOS window for debugging.
If you right-click on the "MS-DOS" icon on the
top-left corner of your DOS window, you should get a
pull-down menu. Pick "Properties", and there is an
option which will allow you to increase the buffer
length. I am on a Linux machine right now, so I am
describing from memory. 

You can make the buffer several thousand lines.
 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Debugging

Posted by Ravishankar S <ra...@ionidea.com>.
yes..i have also used Forte for Java Comm edition...v2 is ok...v 3 is a
little too heavy....hangs a lot...anyway with win98 it's like
asking a horse to tow a battletank:-)))

on linux it's a totally different story which i don't want to discuss.....

r

----- Original Message -----
From: "Trenton D. Adams" <tr...@telusplanet.net>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Thursday, June 13, 2002 10:55 AM
Subject: RE: Debugging


> Actually, Forte and netbeans are both free.  Forte and netbeans can
> debug at runtime.  You can set break points and everything.
>
> -----Original Message-----
> From: Ravishankar S [mailto:ravi.shankar@ionidea.com]
> Sent: June 12, 2002 11:18 PM
> To: Tomcat Users List
> Subject: Re: Debugging
>
>
> hi trenton,
>
> if u have some fancy IDE like Visual Age/Visual Cafe' u can debug
> applications at runtime...but sadly the vast majority of us cannot
> afford such tools..so we print to the console...however my box is win98
> and the console window does not scroll beyond 50 lines..so i wrote a
> simple log file.. and i pipe the output to the file.....in a production
> environment u can then parse this logfile for errors,excptions etc using
> any regexp package or perl scripts..i have found it very useful..here is
> the code
>
> import java.io.*;
>
> public class LogFile {
>
>     /** Creates new LogFile */
>     public LogFile() {}
>
>     public static void log(String str) {
>
>         try {
>             File f = new File("C:/wclog.txt");
>
>             f.createNewFile();
>
>             RandomAccessFile out = new RandomAccessFile(f, "rw");
>
>             out.seek(out.length());
>             out.writeUTF("\n");
>             out.writeUTF(str);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> }
>
> import this file in ur servlet/JSP and use LogFile.log("<ur commenrts
> etc>")....
>
> hope this is useful..
>
> ravi
>
> ----- Original Message -----
> From: "RNivas" <rn...@hotpop.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Monday, June 24, 2002 10:29 AM
> Subject: Re: Debugging
>
>
> > usually I do work to get the out put on tomcat console(some time) most
>
> > of the instances I take output on browser screen.
> >
> > Wishes
> >
> > ----- Original Message -----
> > From: "Trenton D. Adams" <tr...@telusplanet.net>
> > To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> > Sent: Wednesday, June 12, 2002 10:42 PM
> > Subject: Debugging
> >
> >
> > > Where could I get information on debugging a web application under
> > > tomcat?  Is there a way of doing it or do you have to just do a
> > > whole bunch of printing to the tomcat screen or web page?
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Debugging

Posted by "Trenton D. Adams" <tr...@telusplanet.net>.
Actually, Forte and netbeans are both free.  Forte and netbeans can
debug at runtime.  You can set break points and everything.

-----Original Message-----
From: Ravishankar S [mailto:ravi.shankar@ionidea.com] 
Sent: June 12, 2002 11:18 PM
To: Tomcat Users List
Subject: Re: Debugging


hi trenton,

if u have some fancy IDE like Visual Age/Visual Cafe' u can debug
applications at runtime...but sadly the vast majority of us cannot
afford such tools..so we print to the console...however my box is win98
and the console window does not scroll beyond 50 lines..so i wrote a
simple log file.. and i pipe the output to the file.....in a production
environment u can then parse this logfile for errors,excptions etc using
any regexp package or perl scripts..i have found it very useful..here is
the code

import java.io.*;

public class LogFile {

    /** Creates new LogFile */
    public LogFile() {}

    public static void log(String str) {

        try {
            File f = new File("C:/wclog.txt");

            f.createNewFile();

            RandomAccessFile out = new RandomAccessFile(f, "rw");

            out.seek(out.length());
            out.writeUTF("\n");
            out.writeUTF(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

import this file in ur servlet/JSP and use LogFile.log("<ur commenrts
etc>")....

hope this is useful..

ravi

----- Original Message -----
From: "RNivas" <rn...@hotpop.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, June 24, 2002 10:29 AM
Subject: Re: Debugging


> usually I do work to get the out put on tomcat console(some time) most

> of the instances I take output on browser screen.
>
> Wishes
>
> ----- Original Message -----
> From: "Trenton D. Adams" <tr...@telusplanet.net>
> To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> Sent: Wednesday, June 12, 2002 10:42 PM
> Subject: Debugging
>
>
> > Where could I get information on debugging a web application under 
> > tomcat?  Is there a way of doing it or do you have to just do a 
> > whole bunch of printing to the tomcat screen or web page?
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Debugging

Posted by Ravishankar S <ra...@ionidea.com>.
hi trenton,

if u have some fancy IDE like Visual Age/Visual Cafe' u can debug
applications at runtime...but sadly the vast majority of us cannot afford
such tools..so we print to the console...however my box is win98 and the
console window does not scroll beyond 50 lines..so i wrote a simple log
file.. and i pipe the output to the file.....in a production environment u
can then parse this logfile for errors,excptions etc using any regexp
package or perl scripts..i have found it very useful..here is the code

import java.io.*;

public class LogFile {

    /** Creates new LogFile */
    public LogFile() {}

    public static void log(String str) {

        try {
            File f = new File("C:/wclog.txt");

            f.createNewFile();

            RandomAccessFile out = new RandomAccessFile(f, "rw");

            out.seek(out.length());
            out.writeUTF("\n");
            out.writeUTF(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

import this file in ur servlet/JSP and use LogFile.log("<ur commenrts
etc>")....

hope this is useful..

ravi

----- Original Message -----
From: "RNivas" <rn...@hotpop.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, June 24, 2002 10:29 AM
Subject: Re: Debugging


> usually I do work to get the out put on tomcat console(some time) most of
> the instances I take output on browser screen.
>
> Wishes
>
> ----- Original Message -----
> From: "Trenton D. Adams" <tr...@telusplanet.net>
> To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> Sent: Wednesday, June 12, 2002 10:42 PM
> Subject: Debugging
>
>
> > Where could I get information on debugging a web application under
> > tomcat?  Is there a way of doing it or do you have to just do a whole
> > bunch of printing to the tomcat screen or web page?
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Debugging

Posted by "Trenton D. Adams" <tr...@telusplanet.net>.
I like the idea of Larry Meadors.  The one about using the JPDA
debugging facilities.  It allows you to directly connect to the tomcat
server's VM with a debugger such as Forte or netbeans and debug right
from there.  It's really great.

-----Original Message-----
From: RNivas [mailto:rnivas@hotpop.com] 
Sent: June 23, 2002 11:00 PM
To: Tomcat Users List
Subject: Re: Debugging


usually I do work to get the out put on tomcat console(some time) most
of the instances I take output on browser screen.

Wishes

----- Original Message -----
From: "Trenton D. Adams" <tr...@telusplanet.net>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, June 12, 2002 10:42 PM
Subject: Debugging


> Where could I get information on debugging a web application under 
> tomcat?  Is there a way of doing it or do you have to just do a whole 
> bunch of printing to the tomcat screen or web page?
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Debugging

Posted by RNivas <rn...@hotpop.com>.
usually I do work to get the out put on tomcat console(some time) most of
the instances I take output on browser screen.

Wishes

----- Original Message -----
From: "Trenton D. Adams" <tr...@telusplanet.net>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, June 12, 2002 10:42 PM
Subject: Debugging


> Where could I get information on debugging a web application under
> tomcat?  Is there a way of doing it or do you have to just do a whole
> bunch of printing to the tomcat screen or web page?
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>