How to Solve Error Message Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000072: Bean declaring a passivating scope must be passivation capable. Bean: Managed Bean [class package.className] with qualifiers [@Default @Named @Any]

Posted on

Introduction

This article will focus on how to solve a specific error message. Actually, the error message appear not only in the output Tab of the NetBeans IDE but also in the NetBeans IDE itself. Specifically, it exist in the editor of the NetBeans IDE where the Java source file. In the output Tab, the following is the error message :.

06:20:36,046 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."app-1.0-SNAPSHOT.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."app-1.0-SNAPSHOT.war".WeldStartService: Failed to start service
at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000072: Bean declaring a passivating scope must be passivation capable. Bean: Managed Bean [class training.web.view.DBConnectionTestView] with qualifiers [@Default @Named @Any]
at [email protected]//org.jboss.weld.bean.ManagedBean.checkType(ManagedBean.java:220)
at [email protected]//org.jboss.weld.bean.AbstractBean.initializeAfterBeanDiscovery(AbstractBean.java:108)
at [email protected]//org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:124)
at [email protected]//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:111)
at [email protected]//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:102)
at [email protected]//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at [email protected]//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.java:513)
06:20:36,049 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"app-1.0-SNAPSHOT.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000072: Bean declaring a passivating scope must be passivation capable. Bean: Managed Bean [class web.view.DBConnectionTestView] with qualifiers [@Default @Named @Any]"}}

Furthermore, in the other part of the NetBeans IDE which is in the NetBeans IDE, especially in the Java file part, there is a warning message appear as follows :

how-to-solve-error-message-caused-by-org-jboss-weld-exceptions-deploymentexception-weld-000072-bean-declaraing-a-passivating-scope-must-be-passivation-capable-bean-managed-bean-with-qualifiers

So, in this context there are error messages triggering it. It actually exist In the output tab following the build, compile and run process of the Java web application. Moreover, the other one exist in the NetBeans IDE.

How to Solve Error Message WELD-000072: Bean declaring a passivating scope must be passivation capable

So, in order to solve the error message, the solution is simple. Actually, it is because the Java Bean class file does not implement ‘Serializable’ interface. Just edit the Java Bean class file above by adding ‘implements Serializable’ as follows :

/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package training.web.view;
import training.web.db.DBConnection;
import java.io.Serializable;
import java.sql.Connection;
import javax.faces.bean.SessionScoped;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
/**
*
* @author Mark Spectre
*/
@Named(value = "dbConnectionTestView")
@ViewScoped
public class DBConnectionTestView implements Serializable {
private Connection connection;
...

In the above, it only shows portion of the Java Bean class file. Especially, in the revision part where it need to have an additional part. In this case, it is in the ‘public class DBConnectionTestView part’. So, just continue and add at the end of it as it exist above.

Leave a Reply