hi Nishant,
You might want to put all your session variable inside HashMap or other 
datatypes that implements Serializable, rather than put it just in a single 
variable. Refer to the javadocs, what are those Serializable data types are. 
Or maybe you can build your own class with something like this :
 public class StoredSessionValue implements Serializable {
 // your session variable goes here
  // your setter and getter method for those variables goes here
}

You did right on your <distributable/> tags.
 On 8/17/05, Nishant Deshpande <[EMAIL PROTECTED]> wrote: 
> 
> Hoping for some help from the tomcat experts on this list.
> 
> I want to ensure all objects stored in sessions are serializable.
> 
> I read that I can put the <distributable/> tag in my web.xml file to
> 'enforce' this.
> 
> But I don't see any enforcing happening. I assumed it would throw
> exceptions at runtime when I did 'setAttribute("xxx",
> SomeNonSerializableObject)'.
> 
> I have put 'distributable' in
> 
> web.xml: <web-app> ... <distributable/> ... </web-app>
> 
> I also have the following in server.xml:
> 
> <DefaultContext reloadable="true" allowLinking="true">
> 
> <Loader className="org.apache.catalina.loader.DevLoader"
> reloadable="true" debug="1"/>
> <Manager className="org.apache.catalina.session.PersistentManager"
> pathname="/cv/data/tmp" debug="5" saveOnRestart="true"
> distributable="true">
> <Store className="org.apache.catalina.session.FileStore"
> directory="/cv/data/tmp"
> debug="5"/>
> </Manager>
> 
> </DefaultContext>
> 
> 
> Am I missing something? How is the serializability enforced?
> 
> Also another question: the serialization does not happen in the
> directory i specify for Store above, rather it happens in the
> $CATALINA_HOME/work/Catalina/* directories. Any ideas about this one?
> 
> Thanks,
> 
> Nishant
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
-------------------------------------------------------------------
http://www.psychotazkia.or.id

Reply via email to