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/07 23:48:00 UTC

What happened to Session.setAttribute in Tomcat 4.0.1???

I have servlet code that worked perfectly this morning on Tomcat 4.0.0.
It uses the Session to store and retreive some data thusly:

public void putSession(HttpServletRequest request) {
 if(request != null) {
  HttpSession session = request.getSession(true);
  if(session != null) {
   session.setAttribute("idnumber", getIdNumberString());
  }
 }
}

This code compiles with no errors in JDK 1.3.  It ran perfectly under
Tomcat 4.0.0.

This morning (after testing this code), I replaced Tomcat 4.0.0 with
4.0.1.  I correctly set up server.xml and my webapps directory structure
as before (working under 4.0.0).  HOWEVER, the code above now generates
an exception:

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)

What gives???

-Richard



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


Re: What happened to Session.setAttribute in Tomcat 4.0.1???

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Sounds like whatever process you used to install 4.0.1 corrupted things.
Did you try to install 4.0.1 directly on top of your 4.0 install?  If so,
this is *always* a risky thing to do.  You're much better off doing a
clean install of the new version, and then copying in your application
stuff.

Craig


On Fri, 7 Dec 2001, Richard S. Huntrods wrote:

> Date: Fri, 07 Dec 2001 15:48:00 -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: What happened to Session.setAttribute in Tomcat 4.0.1???
>
> I have servlet code that worked perfectly this morning on Tomcat 4.0.0.
> It uses the Session to store and retreive some data thusly:
>
> public void putSession(HttpServletRequest request) {
>  if(request != null) {
>   HttpSession session = request.getSession(true);
>   if(session != null) {
>    session.setAttribute("idnumber", getIdNumberString());
>   }
>  }
> }
>
> This code compiles with no errors in JDK 1.3.  It ran perfectly under
> Tomcat 4.0.0.
>
> This morning (after testing this code), I replaced Tomcat 4.0.0 with
> 4.0.1.  I correctly set up server.xml and my webapps directory structure
> as before (working under 4.0.0).  HOWEVER, the code above now generates
> an exception:
>
> 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)
>
> What gives???
>
> -Richard
>
>
>
> --
> 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>