christina christina - 1 year ago 120
Java Question

Java Error:WELD-000072 Managed bean declaring a passivating scope must be passivation capable

I wrote a simple program in java web forms but i am receiving the following error:


WELD-000072 Managed bean declaring a passivating scope must be passivation capable. Bean: Managed Bean [class BeanPakage.DemoBeans] with qualifiers [@Any @Default @Named]


can anyone tell me where this error comes from?

my code is:

package BeanPakage;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;


@Named("DemoBeans")
@SessionScoped
public class DemoBeans
{

private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}




}

Answer Source

You can make your bean passivation capable by implementing the Serializable interface:

public class DemoBean implements Serializable { ... }

Note that there are more requirements for being passivation capable. Refer to the Weld documentation for more information.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download