You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by liu gang <gg...@hotmail.com> on 2003/05/22 05:59:16 UTC

a strange problem with struts

    I meet a strange problem when I write a database program with struts. 
after i start up tomcat server, all thing is right. however, after a while, 
my web app don't give any response.I add some log statement in the 
ActionServlet.java and my Action class, and find that the app is halted at 
the processActionPerform(). more detail is as follow:

=================================================================
//this is ActionServlet.java code,i add some log statement for debug    
protected ActionForward processActionPerform(Action action,
                                        ActionMapping mapping,
                                        ActionForm formInstance,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
	throws IOException, ServletException {

	log("entering processActionperfom");
ActionForward forward =action.perform(mapping, formInstance, request, 
response);
          log("exiting processactionperform");
        return (forward);

    }
======================================================================
//this is my LoggoffAction code
public final class LogoffAction extends Action
{
    public ActionForward perform(ActionMapping mapping,
				 ActionForm form,
				 HttpServletRequest request,
				 HttpServletResponse response)
	throws ServletException
	{
	    Logger log=Logger.getLogger(LogoffAction.class);
               log("entering logoffaction perform()");
               HttpSession session=request.getSession();
	    session.removeAttribute("USER");
	    session.invalidate();
               
	    return(mapping.findForward("success"));
   }
}
=======================================================================
when the web app run to ActionServlet.processActionPerform, the log output 
is:
* entering processActionperfom
However, the app is halted in this point, "exiting processActionperfrom" 
and "entering logoffaction perform" don't output.  after that, access to 
other Action of the web app is halted at processActionPerform(). especially 
, no any exception throws.

i think "action.perform()" can't execute at all, but i don't know why. 
Because at the begining, my web app run well. perhaps the problem is 
related to log4j or commons-dbcp. my other action use dbcp for db 
connection.  

my development environment is:
* tomcat4.1.12
* struts1.0.2
* jdk1.3.0
* commons-dbcp, log4j

anyone can help me? thanks in advanced.

liugang
2003/5/22

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: a strange problem with struts

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Liu,

you need to check everything comprehensively.

Does tomcat crash? I mean, do other apps carry on working in tomcat?

Have you checked the log files for exceptions, or the standard out as well?

Can you check your database resources, e.g. connections?

Try upgrading tomcat (4.1.24 is available), or your jdbc driver.

Adam

liu gang wrote:
>    I meet a strange problem when I write a database program with struts. 
> after i start up tomcat server, all thing is right. however, after a 
> while, my web app don't give any response.I add some log statement in 
> the ActionServlet.java and my Action class, and find that the app is 
> halted at the processActionPerform(). more detail is as follow:
> 
> =================================================================
> //this is ActionServlet.java code,i add some log statement for debug    
> protected ActionForward processActionPerform(Action action,
>                                        ActionMapping mapping,
>                                        ActionForm formInstance,
>                                        HttpServletRequest request,
>                                        HttpServletResponse response)
>     throws IOException, ServletException {
> 
>     log("entering processActionperfom");
> ActionForward forward =action.perform(mapping, formInstance, request, 
> response);
>          log("exiting processactionperform");
>        return (forward);
> 
>    }
> ======================================================================
> //this is my LoggoffAction code
> public final class LogoffAction extends Action
> {
>    public ActionForward perform(ActionMapping mapping,
>                  ActionForm form,
>                  HttpServletRequest request,
>                  HttpServletResponse response)
>     throws ServletException
>     {
>         Logger log=Logger.getLogger(LogoffAction.class);
>               log("entering logoffaction perform()");
>               HttpSession session=request.getSession();
>         session.removeAttribute("USER");
>         session.invalidate();
>                       return(mapping.findForward("success"));
>   }
> }
> =======================================================================
> when the web app run to ActionServlet.processActionPerform, the log 
> output is:
> * entering processActionperfom
> However, the app is halted in this point, "exiting processActionperfrom" 
> and "entering logoffaction perform" don't output.  after that, access to 
> other Action of the web app is halted at processActionPerform(). 
> especially , no any exception throws.
> 
> i think "action.perform()" can't execute at all, but i don't know why. 
> Because at the begining, my web app run well. perhaps the problem is 
> related to log4j or commons-dbcp. my other action use dbcp for db 
> connection. 
> my development environment is:
> * tomcat4.1.12
> * struts1.0.2
> * jdk1.3.0
> * commons-dbcp, log4j
> 
> anyone can help me? thanks in advanced.
> 
> liugang
> 2003/5/22
> 
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org