Hi There,

I think either I am missing the point, or my message was not clear :) I totally 
understand the persistent thing. I understand the transient keyword. 

However, my real question is "why" does MyLinks have to be altered at all, when none 
of my "other" session objects have a problem. "Tomcat" seems to be picking on the 
MyLinks object in particular. For example, I have a User object in session but that is 
not Serializable. Tomcat does not complain about this. 

So my question is not about Serialization in general, it is about why Tomcat is 
deciding to throw exceptions for "1" of my session objects and not others. Why should 
it care about MyLinks and not User?

Cheers, hope this is clearer, ADC

-----Original Message-----
From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED]
Sent: 30 January 2004 10:46
To: 'Tomcat Users List'
Subject: RE: IOException while loading persisted sessions continued..


If you read a bit further down:

"When traversing a graph, an object may be encountered that does not support
the Serializable interface. In this case the NotSerializableException will
be thrown and will identify the class of the non-serializable object."

If you want session serialization, you will have to make the MyLinks class
implement this interface. If you don't want the fields inside this class to
be serialized, make them transient.

Andy


-----Original Message-----
From: Allistair Crossley [mailto:[EMAIL PROTECTED] 
Sent: 30 January 2004 10:20
To: Tomcat Users List
Subject: RE: IOException while loading persisted sessions continued..


It says "Classes that do not implement this interface will not have any of
their state serialized or deserialized"

So, to me that means I do not have to put Serializable if I do not want my
MyLinks class to be persisted. But Tomcat is throwing an error which means
it thinks MyLinks "should" be Serialized for some reason. 

I do not want MyLinks to be Serializable. Why does Tomcat throw an error for
this object and for no others? 

Thanks ADC

-----Original Message-----
From: Yiannis Mavroukakis [mailto:[EMAIL PROTECTED]
Sent: 30 January 2004 09:50
To: 'Tomcat Users List'
Subject: RE: IOException while loading persisted sessions continued..


No this is Java specific, not Tomcat. See
http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html

Yiannis

-----Original Message-----
From: Allistair Crossley [mailto:[EMAIL PROTECTED]
Sent: 30 January 2004 09:43
To: TOMCAT USER (E-mail)
Subject: IOException while loading persisted sessions continued..


Yes, but I don't want to may this object Serializable - is this Tomcat
specific? I have plenty of other objects in session but they don't have
these errors thrown??
Cheers, ADC
-- snip --
When tomcat persists sessions, it will try to serialize all objects stored
in your sessions to disk. In order to be successful, all the objects must be
serializable.
In this example, the class
com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link is not serializable - it
does not implement the Serializable interface.

Vitor

-- snip --

Allistair Crossley wrote:
Hi,

I quite often but not always get a huge stack trace thrown when Tomcat boots
up the top part of which is the following. I'm not sure why it thinks it
needs to be loading anything to do with my bean here from persisted
sessions. Is that a setting that I have switched on that I need to switch
off? Like I say, only happens on every 3rd or 4th reboot (development
instance) and it does not stop TC5.0.18 working either.

        SEVERE: IOException while loading persisted sessions:
java.io.WriteAbortedExcept
        ion: writing aborted; java.io.NotSerializableException: 
        com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link
        java.io.WriteAbortedException: writing aborted;
java.io.NotSerializableException
        : com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link
               at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
               at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
               at java.util.LinkedList.readObject(LinkedList.java:702)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
               at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)

        Cheers ADC



<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com";>www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.


Note:__________________________________________________________________
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.

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

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


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

Reply via email to