i have the same application in 2 systems(laptops) but its working in one but not in another.i get the following error in another system. i have also posted the code below.wh
Some server configurations need to save HTTP sessions on harddisk or need to transfer them over network to some central datastore, often with the goal to share the session between multiple servers in a cluster, or to minimize excessive memory usage. This in turn requires that all session attributes implement Serializable so that the server could use ObjectOutputStream to convert Java objects to bytes which can then be saved on disk or transferred over network and ObjectInputStream to convert those bytes back to Java objects.
If an object which is stored in the HTTP session does not implement Serializable
, then you will get a NotSerializableException
with the full qualified class name in the message. You should then fix the class to implement Serializable
.
public class StockOrderBean implements Serializable {
// ...
}
In JSF, this applies to all view and session scoped managed beans. Request and application scoped beans doesn't need to implement Serializable
. Note that all of the bean properties should also be Serializable
. But you will get a clear enough NotSerializableException
whenever one is encountered.