This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Why do I need to serialize ALL session objects?

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I probably have mentioned this before, but my (recent) past desktop development server was Resin. I've been putting objects into sessions and getting them out just fine. But I tried to run my webapp on iAS SP4 on my desktop (W2K) and it choked. The stack trace makes me thing it choked on the objects I'm putting into the sessions, complaining that they aren't serializable. Since when was that a requirement for .WAR webapps??
Has anyone else had this happen? Has it happened on the Solaris iAS? Is this some option in the server that I haven't found yet, or a requirement that I can't get around and I'm just going to have to make all my session objects serializable?
Thanks! Here's the stack trace:
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've used ias6SP4 on my Win2000 desktop and haven't run into this. On the other hand, I've only used Java API provided objects, most of which implement Serializable.

From the spec (servlet 2.3):
There's stuff in there that doesn't apply, but it gives some hint as to why iPlanet might object if the objects are not serializable. So I've highlighted the part I think is tripping your code up. Looks like iPlanet requires your objects to support serialization, which is not a hugely awful thing (or is it?).
[ February 16, 2002: Message edited by: Mike Curwen ]
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The evidence piles up:

Here's a document from the days of NAS (thank GOD things got simpler)

http://developer.iplanet.com/viewsource/gee_nas/gee_nas_p.html

Search that page for "java.io.Serializable" and the paragraph it is in, explains that objects to be placed into a session MUST implement it.

I'll post again if I can find something relating to iPlanet 6
 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mike! Using your notes and some additional research, I finally got the whole picture. The biggest help was the release notes, which listed this as one of their ongoing issues. Apparently you have to set the "session-impl" in ias-web.xml to be "lite". Related is a suggestion to use "sticky" load balancing. Apparently NAS (now iPlanet) sessions try to be distributed by default, and in order to set copies of the session info from one session to another, the data is moved out of the JVM and into the KXS, hence the serialization requirement. After playing around a bit I finally got it configured so I can use non-serializable objects into sessions.
Thanks for the help!
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic