This discussion is archived
2 Replies Latest reply: Aug 27, 2009 5:15 PM by user94397 - oracle RSS

Object must be serializable for setAttribute()?

717621 Newbie
Currently Being Moderated
Dear all,

I find that if I bind an object that is not serializable to a SIP session using setAttribute(), OCCAS will generate an exception. Must all session bound objects be serializable?

Thanks.
  • 1. Re: Object must be serializable for setAttribute()?
    465506 Newbie
    Currently Being Moderated
    If you wish to run your application in a distributed environment, then the values of session attributes must be Serializable.

    http://download.oracle.com/docs/cd/E13153_01/wlcp/wlss40/programming/bestpractices.html#wp1080660

    If you do not need to run in a distributed environment, then you can disable persistence, which should eliminate the Exceptions:

    http://edocs.bea.com/wlcp/wlss40/configref/enginetier_dd.html#wp1055890
  • 2. Re: Object must be serializable for setAttribute()?
    user94397 - oracle Newbie
    Currently Being Moderated
    If you are working in distributed env, then as pointed out in above reply, yes objects stored in session must be serializable.
    You specify that application is distributable via sip.xml by defining distributable element

    If you don't specify distributable tag, then non-serializable objects are not stored and a warning will be generated

    Can you also paste here the exception trace ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points