On Tue, 4 Feb 2003, Sundar Narasimhan wrote:

> Date: Tue, 4 Feb 2003 23:35:38 -0500
> From: Sundar Narasimhan <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: session timeout not working anymore :(
>
> Hi, I'm running out of options -- but is there a problem with
> getSession(false)?
>
> Sigh. We used to have a piece of code included in our jsp's like so:
> ----header-inc----
> <% if (request.getSession(false) == null) { %>
>       <jsp:forward page="logout.jsp?TIMEOUT=60"> </jsp:forward>
> <% } %>
> <jsp:useBean id="user" scope="session" class="webapps.common.User"/>
> ----header-inc----
> and that was included in our files like so. That used to work.. but
> now when I have struts-html and struts-bean.. it always fails.
> Is there something wrong with getSession(false) now?
>
> The stack doesn't seem to include the struts generated servlets.. so
> I'm really puzzled!!
>
> Any help will be much appreciated even if it's only to say.. "it's not
> struts" :)
>

That's the right answer :-).  The exception is not happening in Struts, it
is happening inside your page.

> I'm running Tomcat 4.18 on Windows XP.
> Thanks.
> ----main.jsp----
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <html:html>
> <HEAD>
> <%@ page
> language="java"
> contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"
> %>
> <META http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1">
> <META name="GENERATOR" content="IBM WebSphere Studio">
> <META http-equiv="Content-Style-Type" content="text/css">
> <LINK href="theme/tigris.css" rel="stylesheet" type="text/css">
> <TITLE></TITLE>
> </HEAD>
>
> <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"
> class="composite">
>     <%@ include file="header-inc.jsp" %>
>
> ---
> javax.servlet.ServletException: class com.ascent.webapps.common.User :
> java.lang.InstantiationException: com.ascent.webapps.common.User

This is the key to the problem -- for some reason, the page is not able to
create an instance of your "com.ascent.webapps.common.User" class.  Why it
is even trying to do so must be in some code you have not shown us yet,
but the most common causes are:

* You don't have a copy of this class visible to the webapp.

* The class is not public.

* The class does not have a public, no-args constructor.

* Somewhere in the constructor, or one of the initialization
  expressions for your class's instance variables, an exception
  is getting thrown.

Craig McClanahan

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

Reply via email to