You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by na...@apache.org on 2001/09/23 02:21:40 UTC

cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade HttpSessionFacade.java Servlet22Interceptor.java

nacho       01/09/22 17:21:40

  Modified:    src/facade22/org/apache/tomcat/facade HttpSessionFacade.java
                        Servlet22Interceptor.java
  Log:
  Bug#3572
  
  Exceptions during binding events make session handling  not work
  
  Reported by michael at x-cellent.com
  
  Revision  Changes    Path
  1.15      +12 -4     jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java
  
  Index: HttpSessionFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- HttpSessionFacade.java	2001/09/17 15:09:33	1.14
  +++ HttpSessionFacade.java	2001/09/23 00:21:40	1.15
  @@ -190,8 +190,12 @@
   		if (oldValue!=null) {
   		    removeAttribute(name);
   		}
  -		((HttpSessionBindingListener) value).valueBound
  -		    (new HttpSessionBindingEvent( this, name));
  +                try{
  +                    ((HttpSessionBindingListener) value).valueBound
  +                        (new HttpSessionBindingEvent( this, name));
  +                } catch ( Throwable th ) {
  +                    log( "Exception during bound event", th );
  +                }
   		realSession.setAttribute( name, value );
   	    }
   	} else {
  @@ -273,8 +277,12 @@
   		object=realSession.getAttribute( name );
   		if( object != null ) {
   		    realSession.removeAttribute(name);
  -		    ((HttpSessionBindingListener) object).valueUnbound
  -			(new HttpSessionBindingEvent( this, name));
  +                    try {
  +                        ((HttpSessionBindingListener) object).valueUnbound
  +                            (new HttpSessionBindingEvent( this, name));
  +                    } catch ( Throwable th ) {
  +                        log("Exception during unbound event", th );
  +                    }
   		}
   	    }
   	} else {
  
  
  
  1.18      +6 -2      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java
  
  Index: Servlet22Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Servlet22Interceptor.java	2001/09/07 04:35:27	1.17
  +++ Servlet22Interceptor.java	2001/09/23 00:21:40	1.18
  @@ -190,8 +190,12 @@
   		if( value instanceof  HttpSessionBindingListener) {
   		    if( debug > 0 )
   			log("valueUnbound " + sess.getId() + " " + key );
  -		    ((HttpSessionBindingListener) value).valueUnbound
  -			(new HttpSessionBindingEvent(httpSess , key));
  +                    try {
  +                        ((HttpSessionBindingListener) value).valueUnbound
  +                            (new HttpSessionBindingEvent(httpSess , key));
  +                    } catch ( Throwable th ) {
  +                        log("Exception during unbound", th ); 
  +                    }
   		    if( removed==null) removed=new Vector();
   		    removed.addElement( key );
   		}