First of all sorry for my rather unclear question. I'm saving the class which contains a non serializable object (this object is a third party class) in the session and from the session any jsp can retrieve this object when no clustering is used. The issue comes when the application is deployed in a clustered environment because the class contains a non serializable object. The error thrown is "Non Serializable Object Exists in the Session" . We are using weblogic server. Can we do anything to make the application work in a clustered environment.
Yes, I know this is analogous to the old "Doc, it hurts when I do this."/"Then don't do that." routine, but unless there are big reasons why the object isn't serializable, this is the easiest solution.
A way to get around this if you can't make the object serializable would be making all access to the object through some kind of remote interface - using RMI, EJBs, etc. - though this would probably be more "tricky" and resource intensive than just making the object serializable.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
To share a Java object, that is not serializable, between JSP pages, when you can't make the object serializable, and can't put it on the session because the non serializable object breaks clustering.
I encountered something like this, with a vendor's proprietary Java API, which was really a poorly documented wrapper for their C API.
In my case, it as ok that the object did not live between requests on the same page, It was only needed to be passed between pages.
What we did was stuff it on the request attribute space, and forward to the second page. Forwarding between pages can then be done with struts, if you are using struts, or your own handler in the jsp code with request.getRequestDispatcher("page2.jsp").forward(request, response);
Error: Keyboard not attached. Press F1 to continue.