You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Morgenstein <jm...@recommend-it.com> on 2000/11/29 18:27:04 UTC

Problem retrieving bean from session....

All-

Three pages into my application I am attempting to retrieve a bean using the
same useBean clause as on the second page (cut and paste here for
comparison):

  <jsp:useBean id="CAMPAIGN" scope="session"
type="com.recommendit.beans.CampaignVB106Bean"  > </jsp:useBean>
  <jsp:useBean id="CAMPAIGN" scope="session"
type="com.recommendit.beans.CampaignVB106Bean"  > </jsp:useBean>

The bean should already be in the session from previous pages; therefore, I
have a type clause instead of a class clause.

I am receiving the following error on a inconsistent basis:
  java.lang.InstantiationException: bean CAMPAIGN  not found within scope

I am using Tomcat 3.2b8 with URL rewriting in conjunction Apache 1.3 on
Redhat Linux 6.2.

Is it possible that the application server is not attaching back to the same
session.  I have started logging the session ids and cookies to a log file
and there may be some mismatch here.

Thoughts?

Thanks for the help.

James M. Morgenstein

Re: Problem with servlet api that ships with 3.2.b8

Posted by Thom Park <tp...@inprise.com>.
Thanks Craig,

I appreciate the quick answer !

-Thom


Craig R. McClanahan wrote:

> Thom Park wrote:
> 
>> I'm having some trouble getting the J2EE CTS tests to pass using Tomcat
>> 3.2.b8.
>> The CTS is complaining that a public static final member has been added
>> to javax.servlet.http.HttpServletResponse class -
>> 
>> e.g.:    public static final int SC_TEMPORARY_REDIRECT = 307;
>> 
>> I can't find this public static defined in either the 2.2 or2.3 servlet
>> specifications.
>> 
>> Does this mean that the servletapi.jar that ships with tomcat 3.2.b8
>> does NOT conform to the servlet 2.2 spec or can I simply ping Sun
>> and ask for a clarification?
>> 
> 
> Hi Thom,
> 
> This line was added to the HttpServletResponse class in the servlet.jar file
> that Tomcat uses.  The change was based on the fact that the new error code was
> added to the servlet 2.2 spec by a published errata:
> 
>     http://java.sun.com/products/servlet/errata.html
> 
> It is possible that the CTS test version you are running does not reflect this
> update -- your best bet would be to talk to your Licensee Engineering
> representative about it.
> 
>> Thanks,
>> 
>> Thom
> 
> 
> Craig
> 
> 


Re: Problem with servlet api that ships with 3.2.b8

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Thom Park wrote:

> I'm having some trouble getting the J2EE CTS tests to pass using Tomcat
> 3.2.b8.
> The CTS is complaining that a public static final member has been added
> to javax.servlet.http.HttpServletResponse class -
>
> e.g.:    public static final int SC_TEMPORARY_REDIRECT = 307;
>
> I can't find this public static defined in either the 2.2 or2.3 servlet
> specifications.
>
> Does this mean that the servletapi.jar that ships with tomcat 3.2.b8
> does NOT conform to the servlet 2.2 spec or can I simply ping Sun
> and ask for a clarification?
>

Hi Thom,

This line was added to the HttpServletResponse class in the servlet.jar file
that Tomcat uses.  The change was based on the fact that the new error code was
added to the servlet 2.2 spec by a published errata:

    http://java.sun.com/products/servlet/errata.html

It is possible that the CTS test version you are running does not reflect this
update -- your best bet would be to talk to your Licensee Engineering
representative about it.

>
> Thanks,
>
> Thom

Craig



Problem with servlet api that ships with 3.2.b8

Posted by Thom Park <tp...@inprise.com>.
I'm having some trouble getting the J2EE CTS tests to pass using Tomcat 
3.2.b8.
The CTS is complaining that a public static final member has been added 
to javax.servlet.http.HttpServletResponse class -

e.g.:    public static final int SC_TEMPORARY_REDIRECT = 307;

I can't find this public static defined in either the 2.2 or2.3 servlet 
specifications.

Does this mean that the servletapi.jar that ships with tomcat 3.2.b8 
does NOT conform to the servlet 2.2 spec or can I simply ping Sun
and ask for a clarification?

Thanks,

Thom



RE: Problem retrieving bean from session....

Posted by James Morgenstein <jm...@recommend-it.com>.
More information....

In my pages I am now logging the current session id, if the session is new,
and the value of all cookies.

In those cases where I am getting an error (and this is on a second or third
page), the session is new and there is a jsessionid cookie even though I
have disabled cookies in the server.xml file, and the value of the
jsessionid cookie does not match the session in use.

What this says to me is that for some reason Tomcat does not find the
existing session, tries to recreate it, and causes my error since I do not
let beans get created in subsequent pages.

Any thoughts on why Tomcat cannot find the session?

Any thoughts on why even if I have cookies disabled, Tomcat is trying to set
a cookie?

Could this have something do with client side caching and/or proxy caches?

Thanks.

James


-----Original Message-----
From: James Morgenstein [mailto:jmorgenstein@recommend-it.com]
Sent: Wednesday, November 29, 2000 12:27 PM
To: tomcat-user@jakarta.apache.org
Subject: Problem retrieving bean from session....


All-

Three pages into my application I am attempting to retrieve a bean using the
same useBean clause as on the second page (cut and paste here for
comparison):

  <jsp:useBean id="CAMPAIGN" scope="session"
type="com.recommendit.beans.CampaignVB106Bean"  > </jsp:useBean>
  <jsp:useBean id="CAMPAIGN" scope="session"
type="com.recommendit.beans.CampaignVB106Bean"  > </jsp:useBean>

The bean should already be in the session from previous pages; therefore, I
have a type clause instead of a class clause.

I am receiving the following error on a inconsistent basis:
  java.lang.InstantiationException: bean CAMPAIGN  not found within scope

I am using Tomcat 3.2b8 with URL rewriting in conjunction Apache 1.3 on
Redhat Linux 6.2.

Is it possible that the application server is not attaching back to the same
session.  I have started logging the session ids and cookies to a log file
and there may be some mismatch here.

Thoughts?

Thanks for the help.

James M. Morgenstein