Announcement Announcement Module
Collapse
No announcement yet.
beans in HttpSession Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • beans in HttpSession

    Hello,

    I have in httpSession bean "userSession" where I store userId. I want to add to this bean getUser() method which retrieves user by id. To accomplish that I tried to add lookup-method for retrieving hibernate based userDAO, setting of userDAO in bean definition. Both cases works fine untill I restart webapp and session is serialized, then I get exceptions regarding serialization. any solutions ?

    Arvis

  • #2
    Unless I'm mistaken, don't expect objects enhanced by CGLib (because that's what's happening) to be serializable. The subclass generated by CGLib includes references to the ApplicationContext, that cannot be serialized in any case...

    You'll have to figure out another way to do this unless of course you don't mind about the persisted sessions...

    regards,
    Alef

    Comment


    • #3
      well, but is so simple case, isn't it really possible ? Actually if I set DAO as transient it simply becomes null after http session get's back. Any ideas then how to set back DAO by hand after serialization ?

      Comment


      • #4
        There was a thread about this a while back:

        http://forum.springframework.org/sho...&postorder=asc

        Ollie
        Last edited by robyn; May 14th, 2006, 06:38 PM.

        Comment

        Working...
        X