You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Richard S. Huntrods" <hu...@nucleus.com> on 2001/12/13 18:05:31 UTC

Try a different approach - What's wrong with catalina.session???

Greetings!

Let's try this again.  From the error message below, it would appear
that there is something WRONG with
"org.apache.catalina.session.StandardSession".  Note from the error that
we get a "java.lang.NoSuchMethodError" - the method does not exist.

After reading the Catalina Javadocs, it becomes aparent there are two
StandardSessionFacade constructors.  One is:

StandardSessionFacade(javax.servlet.http.HttpSession session);
the other is
StandardSessionFacade(org.apache.catalina.session.StandardSession
session)

It would appear that the catalina session version is getting called by
default, because I ask for no specific one in my code.  The problem is
that there is NO "StandardSession" class, according to the javadocs - or
if there is (undocumented), it is missing the "putSession" method, as
stated in the error.

I think this is a BUG in Catalina.  Why call one particular constructor
by default, which does not use the standard javax classes, and then NOT
supply all the required session methods?  NOTE - this constructor is
called OUTSIDE my code by other Catalina code - I have no real control
over which constructor is used.

Does anyone in the developmer community know of a workaround?

java.lang.NoSuchMethodError
 at
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1185)

 at
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)

 at
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:191)

 at
qti.object.Login.putSession(Login.java:572)




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Try a different approach - What's wrong with catalina.session???

Posted by Mika Goeckel <mi...@gmx.de>.
Hmmm....

the difference between these two constructors is, that the one which takes a
StandardSession upcasts it to HttpSession before assigning it to it's
session attribute,
this should not cause this problem, as StandardSession does implement all
HttpSession methods (otherwise the compiler would want to have it declared
abstract).

>From my (I confess very distant) position it looks like a jvm on W2K
problem. Especially because you say it does work on Solaris.

Mika

----- Original Message -----
From: "Richard S. Huntrods" <hu...@nucleus.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, December 13, 2001 6:05 PM
Subject: Try a different approach - What's wrong with catalina.session???


> Greetings!
>
> Let's try this again.  From the error message below, it would appear
> that there is something WRONG with
> "org.apache.catalina.session.StandardSession".  Note from the error that
> we get a "java.lang.NoSuchMethodError" - the method does not exist.
>
> After reading the Catalina Javadocs, it becomes aparent there are two
> StandardSessionFacade constructors.  One is:
>
> StandardSessionFacade(javax.servlet.http.HttpSession session);
> the other is
> StandardSessionFacade(org.apache.catalina.session.StandardSession
> session)
>
> It would appear that the catalina session version is getting called by
> default, because I ask for no specific one in my code.  The problem is
> that there is NO "StandardSession" class, according to the javadocs - or
> if there is (undocumented), it is missing the "putSession" method, as
> stated in the error.
>
> I think this is a BUG in Catalina.  Why call one particular constructor
> by default, which does not use the standard javax classes, and then NOT
> supply all the required session methods?  NOTE - this constructor is
> called OUTSIDE my code by other Catalina code - I have no real control
> over which constructor is used.
>
> Does anyone in the developmer community know of a workaround?
>
> java.lang.NoSuchMethodError
>  at
>
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.jav
a:1185)
>
>  at
>
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)
>
>  at
>
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)
>
>  at
> qti.object.Login.putSession(Login.java:572)
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Try a different approach - What's wrong with catalina.session???

Posted by Mika Goeckel <mi...@gmx.de>.
Hi!

What is the putSession() method of a HttpSession?
Do you mean putValue?
First, this is a deprecated method, but second, StandardSession implements
that method anyway.
StandardSession is org.apache.catalina.session.StandardSession, and
implements HttpSession, which is an interface and as such not
instantiateable.

The exception points to another reason, but I can't tell without knowing
what exact version of Tomcat you use and what you pass in.

Mika

----- Original Message -----
From: "Richard S. Huntrods" <hu...@nucleus.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, December 13, 2001 6:05 PM
Subject: Try a different approach - What's wrong with catalina.session???


> Greetings!
>
> Let's try this again.  From the error message below, it would appear
> that there is something WRONG with
> "org.apache.catalina.session.StandardSession".  Note from the error that
> we get a "java.lang.NoSuchMethodError" - the method does not exist.
>
> After reading the Catalina Javadocs, it becomes aparent there are two
> StandardSessionFacade constructors.  One is:
>
> StandardSessionFacade(javax.servlet.http.HttpSession session);
> the other is
> StandardSessionFacade(org.apache.catalina.session.StandardSession
> session)
>
> It would appear that the catalina session version is getting called by
> default, because I ask for no specific one in my code.  The problem is
> that there is NO "StandardSession" class, according to the javadocs - or
> if there is (undocumented), it is missing the "putSession" method, as
> stated in the error.
>
> I think this is a BUG in Catalina.  Why call one particular constructor
> by default, which does not use the standard javax classes, and then NOT
> supply all the required session methods?  NOTE - this constructor is
> called OUTSIDE my code by other Catalina code - I have no real control
> over which constructor is used.
>
> Does anyone in the developmer community know of a workaround?
>
> java.lang.NoSuchMethodError
>  at
>
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.jav
a:1185)
>
>  at
>
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)
>
>  at
>
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessi
onFacade.java:191)
>
>  at
> qti.object.Login.putSession(Login.java:572)
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Working fine now . .

Posted by Michael Armstrong <ma...@austin.rr.com>.
    Thanks for all your help.  Tomcat 4.0 seems to be working fine now.  On
to more coding . . .

    Well, crap!  My problem was my own stupid coding oversite: incorrect
assignement statements in my autoexec.bat file.



----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, December 13, 2001 10:52 AM
Subject: Re: Try a different approach - What's wrong with
catalina.session???


>
>
> On Thu, 13 Dec 2001, Richard S. Huntrods wrote:
>
> > Date: Thu, 13 Dec 2001 10:05:31 -0700
> > From: Richard S. Huntrods <hu...@nucleus.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: "tomcat-user@jakarta.apache.org" <to...@jakarta.apache.org>
> > Subject: Try a different approach - What's wrong with
catalina.session???
> >
> > Greetings!
> >
> > Let's try this again.  From the error message below, it would appear
> > that there is something WRONG with
> > "org.apache.catalina.session.StandardSession".  Note from the error that
> > we get a "java.lang.NoSuchMethodError" - the method does not exist.
> >
>
> This kind of problem indicates that your Tomcat installation is somehow
> corrupted.  If it were really a bug, it would be happening to everyone,
> not just to you.
>
> I suggest that you do the following:
>
> * Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
>   (most *especially* not things like servlet.jar or j2ee.jar,
>   which are *guaranteed* to cause nothing but grief)
>
> * Do a clean installation of Tomcat 4 into a new directory.
>
> * Make sure that all the examples work (including the ones that
>   use sessions)
>
> * Install your applications and test.
>
> Craig McClanahan
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Try a different approach - What's wrong with catalina.session???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 13 Dec 2001, Richard S. Huntrods wrote:

> Date: Thu, 13 Dec 2001 10:05:31 -0700
> From: Richard S. Huntrods <hu...@nucleus.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "tomcat-user@jakarta.apache.org" <to...@jakarta.apache.org>
> Subject: Try a different approach - What's wrong with catalina.session???
>
> Greetings!
>
> Let's try this again.  From the error message below, it would appear
> that there is something WRONG with
> "org.apache.catalina.session.StandardSession".  Note from the error that
> we get a "java.lang.NoSuchMethodError" - the method does not exist.
>

This kind of problem indicates that your Tomcat installation is somehow
corrupted.  If it were really a bug, it would be happening to everyone,
not just to you.

I suggest that you do the following:

* Make sure you do not have anything in $JAVA_HOME/jre/lib/ext
  (most *especially* not things like servlet.jar or j2ee.jar,
  which are *guaranteed* to cause nothing but grief)

* Do a clean installation of Tomcat 4 into a new directory.

* Make sure that all the examples work (including the ones that
  use sessions)

* Install your applications and test.

Craig McClanahan


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>