RE: Servlets and debugging

2004-11-23 Thread Benson Margulies
Two thoughts:

1: startup time can be further shrunk by lightly editing the config to
remove the default load balancing app and the like.

2: I do all this using eclipse + MyEclipse, and I've found it quite
satisfactory. 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Servlets and debugging

2004-11-23 Thread Shapira, Yoav

Hi,

>copy it to the classes directory, restart Tomcat (which takes several
>minutes)

Restarting Tomcat doesn't take several minutes unless you have added
other webapps that do significant processing on startup/shutdown, or
significantly modified the Tomcat out-of-the-box configuration.

>and read the Tomcat logs to find out whats gone wrong!

The logs are useful no matter what IDE or debugging approach you're
using.  Get proficient at analyzing them.

You will always have to recompile a class after making changes to it,
that's nothing specific to Tomcat or servlets.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlets and debugging

2004-11-23 Thread sven morales
  The IDE suggested by others may already have this
features, but Apache Axis tcpmon is a neat tool to
have if you do not use IDE's.  It allows you to see
what is being sent to a servlet running on Tomcat and
vice versa, the response coming out. Easy to use, as
it is an applet and run like so:

java -cp axis.jar org.apache.axis.utils.tcpmon 8081
localhost 8080

It basically sits between Tomcat and your
browser/client app. You get to monitor the interaction
between browser and Tomcat.   Good Luck.


--- Ben Souther <[EMAIL PROTECTED]> wrote:

>   
> > invoker
> > /servlet/*
> >   
> > (No one had ever said before about the
> > servlet-mapping directive.)
> 
> There are good reasons why the invoker servlet has
> been removed
> (commented out) of the default web.xml in Tomcat.
> http://jakarta.apache.org/tomcat/faq/misc.html#evil
> 
> You would be much better off to explicitly map each
> servlet in your
> web.xml file.
> 
> 
> > (No one had ever said before about the
> servlet-mapping directive.)
> This wasn't covered in the "First Webapp" tutorial?
>
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html
> 
> > I have to compile the servlet,
> > copy it to the classes directory, restart Tomcat
> (which takes several
> > minutes) and read the Tomcat logs to find out
> whats gone wrong!
> > Nightmare! <:-o
> This is only my 2 cents but I think that, until you
> have a firm 
> grasp on how all this works, the method you've just
> described is
> the best way to debug them.  Once you've got it, you
> might want to speed
> things up with an IDE debugger.
> 
> There are some little things you can do to speed
> things up like setting 
> reloadable to true so you don't need to restart
> tomcat and by either
> putting your src in the the classes directory (or
> using the -d switch in
> javac) so you don't have to copy the class files. 
> If you're on Unix the
> tail -f command will allow you to view your logs as
> Tomcat writes to
> them. There are some editors that will allow you to
> do the same thing in
> Windows. Textpad is one of them.
> 
> If you're interested, I put some small simple
> examples on a website that
> you can download and run. They are all WAR files so
> running them is as
> easy as dropping them in your webapps directory.
> http://simple.souther.us
> 
> Good-Luck
> -Ben
> 
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 




__ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlets and debugging

2004-11-23 Thread Ben Souther
  
> invoker
> /servlet/*
>   
> (No one had ever said before about the
> servlet-mapping directive.)

There are good reasons why the invoker servlet has been removed
(commented out) of the default web.xml in Tomcat.
http://jakarta.apache.org/tomcat/faq/misc.html#evil

You would be much better off to explicitly map each servlet in your
web.xml file.


> (No one had ever said before about the servlet-mapping directive.)
This wasn't covered in the "First Webapp" tutorial?
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html

> I have to compile the servlet,
> copy it to the classes directory, restart Tomcat (which takes several
> minutes) and read the Tomcat logs to find out whats gone wrong!
> Nightmare! <:-o
This is only my 2 cents but I think that, until you have a firm 
grasp on how all this works, the method you've just described is
the best way to debug them.  Once you've got it, you might want to speed
things up with an IDE debugger.

There are some little things you can do to speed things up like setting 
reloadable to true so you don't need to restart tomcat and by either
putting your src in the the classes directory (or using the -d switch in
javac) so you don't have to copy the class files.  If you're on Unix the
tail -f command will allow you to view your logs as Tomcat writes to
them. There are some editors that will allow you to do the same thing in
Windows. Textpad is one of them.

If you're interested, I put some small simple examples on a website that
you can download and run. They are all WAR files so running them is as
easy as dropping them in your webapps directory.
http://simple.souther.us

Good-Luck
-Ben





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlets and debugging

2004-11-23 Thread Dave Robbins
Richard,

I'm certainly no expert but I've been playing with this stuff a while and
I find the free netbeans IDE to be an excellent environment for learning
this stuff. It come with a copy of tomcat built into it so you can debug
your servlet from within the IDE. With the click of a buton it will
generate a skeleton servlet that does nothing except print hello world and
then you can set breakpoints in the code and debug it and watch it execute
one line at a time. I don't know how people survive without such a tool.
Eclipse is another IDE people think highly of but I'm not familiar with
it. Check out netbeans at

www.netbeans.org

I'd stick with version 3.6 for now
good luck

Dave

> After a few years of trying on and off I've finally managed to make a
> servlet work in Tomcat (4.1).
>
> I had to add:
>   
> StudioSearch
> StudioSearch
>   
>   
> invoker
> /servlet/*
>   
> to webapps/ROOT/WEB-INF/web.xml. (No one had ever said before about the
> servlet-mapping directive.). I'll install it in a better location when
> its working, I'm just using the root webapp for debugging.
>
> So now I need to try and make my servlet work. Obviously there are lots
> of bugs in the Java code itself but I wonder if anyone could suggest a
> good way of testing servlet code? ATM, I have to compile the servlet,
> copy it to the classes directory, restart Tomcat (which takes several
> minutes) and read the Tomcat logs to find out whats gone wrong!
> Nightmare! <:-o
>
> How do people who know what they're doing go about debugging servlets?
>
> Thanks in advance,
> Richard
> --
>   Richard Lewis
>   [EMAIL PROTECTED]
>
>
> - To
> unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]