On Sep 3, 2007, at 1:46 AM, Daniel López wrote:

> Hi,
>
> I have some objects in a library that I'm using that are usually  
> stored
> in the session. Up to now, everything worked fine but recently I  
> decided
> to do some refactoring to update the version to Java 5 and I  
> "basically"
> changed a member from being a Hashtable to being a Map (HashMap as
> implementation).

Is it possible that the old persistent data is still based on the pre- 
refactoring information, e.g. if you had a very long session live time?

-- Scott

>
> Since then, whenever the session needs to be recovered from file, like
> when the context is reloaded automatically, I get this error and the
> session is not recovered:
>
> **********************************************************************
> java.lang.ClassCastException: cannot assign instance of  
> java.lang.String
> to field org.leaf.security.ActiveUsersCache.userMap of type  
> ava.util.Map
> in instance of org.leaf.security.ActiveUsersCache
> at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues 
> (ObjectStre
> amClass.java:2032)
> at java.io.ObjectStreamClass.setObjFieldValues 
> (ObjectStreamClass.java:12
> 12)
> at java.io.ObjectInputStream.defaultReadFields 
> (ObjectInputStream.java:19
> 51)
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 
> 1869)
> at java.io.ObjectInputStream.readOrdinaryObject 
> (ObjectInputStream.java:1
> 753)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at java.io.ObjectInputStream.defaultReadFields 
> (ObjectInputStream.java:19
> 45)
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 
> 1869)
> at java.io.ObjectInputStream.readOrdinaryObject 
> (ObjectInputStream.java:1
> 753)
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
> at com.caucho.server.session.SessionImpl.load(SessionImpl.java:962)
> at com.caucho.server.session.SessionManager.load 
> (SessionManager.java:150
> 7)
> at com.caucho.server.cluster.ClusterObject.load(ClusterObject.java: 
> 301)
> at com.caucho.server.cluster.FileBacking.loadSelf(FileBacking.java: 
> 299)
> at com.caucho.server.cluster.FileStore.load(FileStore.java:143)
> at com.caucho.server.cluster.ClusterObject.load(ClusterObject.java: 
> 268)
> at com.caucho.server.session.SessionImpl.load(SessionImpl.java:741)
> at com.caucho.server.session.SessionManager.load 
> (SessionManager.java:144
> 4)
> at com.caucho.server.session.SessionManager.getSession 
> (SessionManager.ja
> va:1303)
> at com.caucho.server.connection.AbstractHttpRequest.createSession 
> (Abstra
> ctHttpRequest.java:1455)
> at com.caucho.server.connection.AbstractHttpRequest.getSession 
> (AbstractH
> ttpRequest.java:1270)
> at _jsp._index__jsp._jspService(_index__jsp.java:20)
> ...
> **********************************************************************
>
> So it seems it is trying to set the field I declared as a Map to a
> String. I've done some tests and serialised/deserialised instances of
> this class without problem; I've also checked all the places where  
> this
> field is used and I have'nt seen anything weird.
>
> It could be my fault, as it is suspicious that it's just happening  
> after
> my changes, but how can I debug the session storage mechanism of Resin
> to see where the things are going wrong? Any easy way I can check a
> stored session if the data in there is correct?
>
> Any idea?
> D.
>
> PD:
> Java 1.6.0_02-b05, 32, mixed mode, Cp1252, es, Sun Microsystems Inc.
> Resin 3.1.1
> Windows XP.
> -------------------------------------------
> Daniel Lopez Janariz ([EMAIL PROTECTED])
> Web Services
> Centre for Information and Technology
> Balearic Islands University
> (SPAIN)
> -------------------------------------------
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to