Hi Keith,
Thanks for your reply.
I do use already many of the techniques listed in your email as well as
log4j.
I do not have any problem catching errors in form and actions classes.
I do have problem finding errors that come out of the html tags in JSPs.
If there is a bad mapping and an html:form's action point to the mapping
with a problem I do not see any errors in any of the logs. I have modified
my error.jsp in hopes of seeing more but so far nothing.
If I have better luck with this I will let the group know.
Developing in Struts would be much faster if there was a way to diagnose
such problems.
Erich

-----Original Message-----
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 8:54 AM
To: Struts Users Mailing List
Subject: Re: Question on Struts debugging - one more time


I've not had better luck. I think it's the way it is.
Here's how I do it - I'd like to know how others do.

I use hundreds of log messages so I can trace the flow of my program. I make
the method calls for
logging easy to type - dbmd("a debug msg") or dbmw("warning message").
I code traces into action classes from the start. to show the perform method
starting & ending so
a dud struts config is found because the Action i expect to run doesn't log
it's start. 
I check for null pointers all over the place & log a warning or throw an
exception for them.
I constantly restart the server (tomcat 3.2.2) to make weird problems go
away.
Auto class reloading doesn't work properly so - I restart after every
compile.

I use these 3 methods in jsp's & Action classes a lot, to check the contents
of the session &
request - this finds things left in the session by mistake.
        public static void printSessionAttributeNames(String caller,
HttpSession session) {
        public static void printRequestAttributeNames(String caller,
HttpServletRequest request) {
        public static void printRequestParameters(String caller,
HttpServletRequest request) {
I've attached the code for them, someone may find them useful - the codes a
bit dodgy & old but
it's easy to understand.

I have my own logging code (from old servlet programming) but I want to use
log4j (one day!) - You
really need to be able to switch trace messages on/off without re-compiling
classes or restarting
the server.

Only when it's quite reliable do I remove the messages. Often I just comment
the mesages out in
expectation it will go wrong in future.

All in all a bit primitive compared to some (non-web) environments I've
worked in. we're in the
early days - things will get easier. We'll get informative/instructive
messages that tell us what
to do to put it right & we'll be able to step thru our action classes in the
debugger.

Happy bug hunting! - Keith


--- "Kilmer, Erich" <[EMAIL PROTECTED]> wrote:
> Thought I would give this one more try. Has anyone had better luck with
> debugging problems caused by say bad action mappings, ie: mis-named action
> classes, missing action forms etc. Currently when these problems are
> encountered I see no useful error messages in any of my logs (even when
> debug is set to 2). 
> Is this just the way that it is or have I failed to do something?
> 
> Thanks,
> Erich
> 
> Sent previously:
> 
> I have been using Struts for some time now. My app's Struts config file
has
> almost 50 action mappings so I have been down this road a time or two. 
> Many times when adding a new mapping I run into errors though. For example
> the latest on was where the mapping listed an action class called
something
> like UserCreateAction (package removed). But when I wrote the class itself
I
> named it UserAddAction.
> Now when I built the app and moved to the Orion apps server and ran it
when
> I get to the JSP that references this action mapping I get a null
exception.
> Typically I do not catch exceptions in a JSP and the uncaught exceptions
go
> to my error JSP where it states that the exception is null.
> So I go into my web.xml file and change the debug param to 2. I also
changed
> detail to 2. (By the way what does detail = 2 do?)
> Then I re-ran everything after rebuilding and re-deploying. The app still
> does the same thing.
> OK, fine now I go to check the logs. I check the apps server log where
> system outs go. I see no Struts messages except for the flurry of them at
> startup. I look at the log4j error logs and see nothing. I also looked at
> the apps servers application log where I see some Struts messages but see
> nothing about this error.
> 
> So my Struts debugging question is this. Are errors encountered when
> converting the Struts tags in my JSP written anywhere? Is there more debug
> settings I must make? Is there another log that I can check?
> 
> I know this is a fairly simple example and I am getting better at
debugging
> them but it would be nice if there was someway to make this so I check the
> log and it says that "Action class UserCreateAction does not exist". 
> 
> Let me know,
> Erich Kilmer
> Bell+Howell
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

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

Reply via email to