DO NOT REPLY [Bug 31655] - org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to serialize delta request, java.io.NotSerializableException:

2004-10-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31655.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31655

org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to 
serialize delta request, java.io.NotSerializableException:

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Severity|Normal  |Critical
Summary|org.apache.catalina.cluster.|org.apache.catalina.cluster.
   |session.DeltaManager|session.DeltaManager
   |requestCompleted, SEVERE:   |requestCompleted, SEVERE:
   |Unable to serialize delta   |Unable to serialize delta
   |request,|request,
   |java.io.NotSerializableExcep|java.io.NotSerializableExcep
   |tion:   |tion:

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



DO NOT REPLY [Bug 31655] - org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to serialize delta request, java.io.NotSerializableException:

2004-10-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=31655.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31655

org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to 
serialize delta request, java.io.NotSerializableException:

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID



--- Additional Comments From [EMAIL PROTECTED]  2004-10-11 22:36 ---
You can determine which attributes are not serializable by writing your own
HttpSessionAttributeListener and checking if the attribute implements serializable.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/javax/servlet/http/HttpSessionAttributeListener.html

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



Re: [Bug 31655] - org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to serialize delta request, java.io.NotSerializableException:

2004-10-11 Thread Ian F . Darwin
The original user was having trouble figuring out which class(es) in  
their application were causing NotSerializableExceptions.
And, in fact, I was starting to think about the Serializable issue for  
a client...

And then Tim wrote:
--- Additional Comments From [EMAIL PROTECTED]  2004-10-11 22:36  
---
You can determine which attributes are not serializable by writing  
your own
HttpSessionAttributeListener and checking if the attribute implements  
serializable.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/javax/ 
servlet/http/HttpSessionAttributeListener.html
This is actually a good idea, Tim :-) So I've written one and will  
polish it up a bit (it goes recursively, first complaining if the  
object is not serializable, then testing if the object being added is a  
Collection...).

Since a number of Tomcat users are not Java programmers, I would like  
to commit this for general use.

But there doesn't seem a good place for it. What would y'all think of  
creating a package called, say, o.a.c.userdiagnostic or  
o.a.tomcat.util.userdiagnostic to serve as a place to store diagnostic  
tools for end-users?  Or is there a good place already?

To be maximally useful it wants to be part of what gets shipped with  
TC, so we can just tell people something like:

	You can do this with an HttpSessionAttributeListener; to use Tomcat's  
default serializable attributes diagnostic  
	HttpSessionAttributeListener just add these lines in your web.xml,  
immediately before the first servlet tag:

	listener
		!-- Used to warn about non-Serializable objects being put in the  
session. --
  
		listener- 
classorg.apache.catalina.userdiagnostic.SerializableCheckAttributeListe 
ner
		/listener-class
	/listener

Ian


Re: [Bug 31655] - org.apache.catalina.cluster.session.DeltaManager requestCompleted, SEVERE: Unable to serialize delta request, java.io.NotSerializableException:

2004-10-11 Thread Tim Funk
Don't bother. Here is it for the archives.
package x;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionAttributeListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
Listener that complains if you try to put nonserializable elements
into your session.
*/
public class SessionListener implements HttpSessionAttributeListener  {
private static Log log = LogFactory.getLog(SessionListener.class);
public SessionListener() {
}
public void attributeAdded(HttpSessionBindingEvent se) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ObjectOutputStream objStream = new ObjectOutputStream(os);
objStream.writeObject(se.getValue());
} catch(IOException e) {
log.warn(Can't serialize attribute[ + se.getName() + ], e);
}
}
public void attributeRemoved(HttpSessionBindingEvent se) {
}
public void attributeReplaced(HttpSessionBindingEvent se) {
}
}
-Tim
Ian F.Darwin wrote:
The original user was having trouble figuring out which class(es) in  
their application were causing NotSerializableExceptions.
And, in fact, I was starting to think about the Serializable issue for  
a client...

And then Tim wrote:
--- Additional Comments From [EMAIL PROTECTED]  2004-10-11 22:36  
---
You can determine which attributes are not serializable by writing  
your own
HttpSessionAttributeListener and checking if the attribute implements  
serializable.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/javax/ 
servlet/http/HttpSessionAttributeListener.html

This is actually a good idea, Tim :-) So I've written one and will  
polish it up a bit (it goes recursively, first complaining if the  
object is not serializable, then testing if the object being added is a  
Collection...).

Since a number of Tomcat users are not Java programmers, I would like  
to commit this for general use.

But there doesn't seem a good place for it. What would y'all think of  
creating a package called, say, o.a.c.userdiagnostic or  
o.a.tomcat.util.userdiagnostic to serve as a place to store diagnostic  
tools for end-users?  Or is there a good place already?

To be maximally useful it wants to be part of what gets shipped with  
TC, so we can just tell people something like:

You can do this with an HttpSessionAttributeListener; to use 
Tomcat's  default serializable attributes diagnostic  
HttpSessionAttributeListener just add these lines in your web.xml,  
immediately before the first servlet tag:

listener
!-- Used to warn about non-Serializable objects being put in 
the  session. --
  listener- 
classorg.apache.catalina.userdiagnostic.SerializableCheckAttributeListe 
ner
/listener-class
/listener

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