This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 11, 2011, 8:00 PM
24 Posts

View Scope causes "java.io.NotSerializableException" error

  • Category: Managed Beans in NSF
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 4
 Greetings,
 
I have a managed bean that executes fine in a session or request scope, but when I set the the  managed-bean-scope to  view,  I get the  "java.io.NotSerializableException" error.
 
Has anyone else come across this? 
 
Thanks, 
 
-- Jeff 
Apr 12, 2011, 11:45 PM
64 Posts
Guess: Re: View Scope causes "java.io.NotSerializableException" error
- viewScope is not a standard JSF scope, it's XPage specific.  I'm thinking the error is coming from something in the viewScope implementation that is not serializing your bean, rather than the bean itself not being serializable.
 
Hope this helps...
Apr 13, 2011, 11:51 AM
40 Posts
Re: Guess: Re: View Scope causes "java.io.NotSerializableException" error
fwiw, he view scope is in JSF 2.0
 
You need to make sure your managed bean implements Serailizable ... if you have members of your class that do not implement serializable you need to provide custom state management methods in your class (saveState and restoreState for example) to handled writing out a serializable plain object so the runtime can save the state of your bean during the renderResponse phase.
Jun 15, 2011, 9:04 AM
33 Posts
Re: Guess: Re: View Scope causes "java.io.NotSerializableException" error
I've been facing the same troubles with a bean stored in ViewScope. As Jeremy suggested it was caused by the member variable that holds the Notes document (lotus.domino.Document) as that class does not implement Serializable interface.
For so far I decided not to keep notes document as member variable and use universalID instead. After this change the bean works fine.
Apr 13, 2011, 2:09 PM
24 Posts
Re: View Scope causes "java.io.NotSerializableException" error
 Thanks for the replies!
 
Jeremy, I did figure out the implement Serailizable. I wasn't sure I was on the right track.  I was going off of your Notes-in-9 Java video and I noticed that you didn't implement Serailizable.   
 
BTW, Thanks for those videos, they really help. 
 
-- Jeff 
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal