Java error: WELD-000072 A managed bean declaring a passive region must be passivated

I wrote a simple program in Java forms, but I get the following error:

WELD-000072 A managed bean declaring a passivating region must have passivation. Bean: Managed bean [BeanPakage.DemoBeans class] with qualifiers [@Any @Default @Named]

can anyone tell me where this error came 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; } } 
+60
java cdi jboss-weld
Mar 18 2018-12-18T00:
source share
6 answers

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

 public class DemoBean implements Serializable { ... } 

Please note that there are more requirements for passivation. See the Weld documentation for more information.

+118
Mar 18 '12 at 17:37
source share

The error may persist even if the CDI bean is serializable:

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

Class Example:

 @Named @ConversationScoped public class TransactionMatchController implements Serializable { ... } 

Make sure all @Interceptors can also be flattened:

 @Interceptor @Transactional public class TransactionInterceptor implements Serializable { ... } 
+19
Aug 31 2018-12-12T00:
source share

Make DemoBeans Serialized

 @Named("DemoBeans") @SessionScoped public class DemoBeans implements Serializable { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } 
+5
Dec 07
source share

It must be serializable.

See this answer.

https://community.jboss.org/thread/179828

Best, Anders

+3
Mar 18 2018-12-18T00:
source share

You can also activate the passivation behavior of your bean using the annotation:

@Stateful (passivationCapable = true)

In this case, you do not need to implement the Serializable interface.

Sincerely. Jorge

+2
Nov 05 '15 at 13:43 on
source share

Check import

(several times netbeans used others from other libraries)

Example. import javax.faces.view.ViewScoped; change it to import javax.faces.bean.ViewScoped;

0
May 23 '17 at 2:18
source share



All Articles