<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: java.io.NotSerializableException in your HttpSession</title>
	<atom:link href="http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/feed/" rel="self" type="application/rss+xml" />
	<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/</link>
	<description>Alastair Maw's small soap box.</description>
	<lastBuildDate>Thu, 10 Nov 2011 14:24:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jon</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-3907</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 05 Mar 2008 04:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-3907</guid>
		<description>Crazy Bob had the same idea: http://crazybob.org/2007/02/debugging-serialization.html</description>
		<content:encoded><![CDATA[<p>Crazy Bob had the same idea: <a href="http://crazybob.org/2007/02/debugging-serialization.html" rel="nofollow">http://crazybob.org/2007/02/debugging-serialization.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alastair</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-16</link>
		<dc:creator>Alastair</dc:creator>
		<pubDate>Mon, 12 Feb 2007 08:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-16</guid>
		<description>Yeah, this turned out to be more complex than we both thought it would be. ;-)

Good work cleaning it up and making it all usable - it&#039;s now looking really nice.</description>
		<content:encoded><![CDATA[<p>Yeah, this turned out to be more complex than we both thought it would be. ;-)</p>
<p>Good work cleaning it up and making it all usable &#8211; it&#8217;s now looking really nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eelco Hillenius</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-15</link>
		<dc:creator>Eelco Hillenius</dc:creator>
		<pubDate>Mon, 12 Feb 2007 07:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-15</guid>
		<description>Unfortunately, our first try was hopelessly naive. Anonymous classes and method level classes weren&#039;t handled, it didn&#039;t recurse parents, didn&#039;t take writeObject and Externalizable into account. And that&#039;s just for starters :/.

It took me the whole friggin&#039; weekend, but I finally have something that works pretty well. I had to hack quite a bit, as the whole serialization department of the JDK is not very accessible, but it should work for most cases, and when it doesn&#039;t I fallback on just printing the original exception.

I&#039;m afraid it&#039;s a bit too large too paste, as the main class, SerializableChecker is almost 700 lines. :)</description>
		<content:encoded><![CDATA[<p>Unfortunately, our first try was hopelessly naive. Anonymous classes and method level classes weren&#8217;t handled, it didn&#8217;t recurse parents, didn&#8217;t take writeObject and Externalizable into account. And that&#8217;s just for starters :/.</p>
<p>It took me the whole friggin&#8217; weekend, but I finally have something that works pretty well. I had to hack quite a bit, as the whole serialization department of the JDK is not very accessible, but it should work for most cases, and when it doesn&#8217;t I fallback on just printing the original exception.</p>
<p>I&#8217;m afraid it&#8217;s a bit too large too paste, as the main class, SerializableChecker is almost 700 lines. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alastair</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-14</link>
		<dc:creator>Alastair</dc:creator>
		<pubDate>Thu, 08 Feb 2007 13:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-14</guid>
		<description>The docs claim you&#039;re on your own if you implement this, and if you look at ObjectOutputStream, it&#039;s not clever in this instance - you really are doing everything manually, including being responsible for invoking your function recursively on all the fields. I don&#039;t see anything in the code that would stop circular references from magically going away.

And yes, it is reliable. The initial isEmpty() is because you want to catch the first invocation of the method so you know what the class is of the top-level object you&#039;re serialising. Subsequent calls are all recursive. You&#039;ll note I push and pop exactly once for each field as I iterate over them. Siblings would therefore appear on the same level of the stack. But it&#039;s a stack, not a tree - I&#039;m only recording the bits of the tree that are directly above me on the stack - that&#039;s the whole point.</description>
		<content:encoded><![CDATA[<p>The docs claim you&#8217;re on your own if you implement this, and if you look at ObjectOutputStream, it&#8217;s not clever in this instance &#8211; you really are doing everything manually, including being responsible for invoking your function recursively on all the fields. I don&#8217;t see anything in the code that would stop circular references from magically going away.</p>
<p>And yes, it is reliable. The initial isEmpty() is because you want to catch the first invocation of the method so you know what the class is of the top-level object you&#8217;re serialising. Subsequent calls are all recursive. You&#8217;ll note I push and pop exactly once for each field as I iterate over them. Siblings would therefore appear on the same level of the stack. But it&#8217;s a stack, not a tree &#8211; I&#8217;m only recording the bits of the tree that are directly above me on the stack &#8211; that&#8217;s the whole point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Compagner</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-13</link>
		<dc:creator>Johan Compagner</dc:creator>
		<pubDate>Thu, 08 Feb 2007 10:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-13</guid>
		<description>Is this really needed:

 // Check for circular reference.  
if (set.contains(obj)) { return; } 

does objectoutputstream really calls write object for the same object twice? I thought this was handled internally by just writing a handle.

Also is this reliable:

if (stack.isEmpty()) { stack.add(&quot;Class &quot;   obj.getClass().getName()); }

How do you know it is really stacked liked that? It doesn&#039;t have to have childs but it could be siblings.</description>
		<content:encoded><![CDATA[<p>Is this really needed:</p>
<p> // Check for circular reference.<br />
if (set.contains(obj)) { return; } </p>
<p>does objectoutputstream really calls write object for the same object twice? I thought this was handled internally by just writing a handle.</p>
<p>Also is this reliable:</p>
<p>if (stack.isEmpty()) { stack.add(&#8220;Class &#8221;   obj.getClass().getName()); }</p>
<p>How do you know it is really stacked liked that? It doesn&#8217;t have to have childs but it could be siblings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eelco Hillenius</title>
		<link>http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/comment-page-1/#comment-11</link>
		<dc:creator>Eelco Hillenius</dc:creator>
		<pubDate>Thu, 08 Feb 2007 02:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://almaw.com/2007-02-08/javaionotserializableexception-in-your-httpsession/#comment-11</guid>
		<description>Hey. Google alerts (sometimes) works fantastic. Half an hour after you published this, I got the alert on &#039;Wicket Java&#039;.  No more secrets :)</description>
		<content:encoded><![CDATA[<p>Hey. Google alerts (sometimes) works fantastic. Half an hour after you published this, I got the alert on &#8216;Wicket Java&#8217;.  No more secrets :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

