Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why do I need to serialize ALL session objects?

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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!
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic