Error: non-serializable attribute value in the visualization map

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.what i want to do is cascading dropdown with a button that calls method of a different managed bean, and a placeOrder button to add a record in database.but i get the following error at the time of page loading

WARNING: Setting non-serializable attribute value into ViewMap: (key: stockOrderBean, value class: beans.stockOrderBean)
    SEVERE: Error Rendering View[/ClientTemplate/stockTrade.xhtml]
    java.io.NotSerializableException: beans.stockOrderBean

    WARNING: JSF1087: Unable to generate Facelets error page as the response has already been committed.
    SEVERE: javax.faces.FacesException: beans.stockOrderBean

xhtmlcode:

                

Ask :

sockOrderBean code:

@javax.faces.bean.ManagedBean
@javax.faces.bean.ViewScoped
public class stockOrderBean{

    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/StatelessWebService/StatelessWebService.wsdl")
    private StatelessWebService_Service service;
//properties with getter setter
 @ManagedProperty(value="#{equtiyBean}")
    private equityBean equity = new equityBean();
public void placeOrder(...){
//method not called
}

the same code is working in one system but not on another.what could be the reason and how do i solve it?

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.

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » Error: non-serializable attribute value in the visualization map

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录