WELD-000072 El frijol administrado que declara un alcance de pasivación debe ser capaz de pasivación


Escribí un programa simple en java web forms pero estoy recibiendo el siguiente error:

WELD-000072 El frijol administrado que declara un alcance de pasivación debe ser capaz de pasivación. Frijol: Frijol manejado [clase BeanPakage.DemoBeans] con calificadores [@Any @Default @Named]

¿Puede alguien decirme de dónde viene este error?

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;
    }
}
Author: Paolo Forgia, 2012-03-18

7 answers

Puedes hacer que tu bean pasivation sea capaz implementando la interfaz serializable:

public class DemoBean implements Serializable { ... }

Obsérvese que hay más requisitos para ser apto para la pasivación. Consulte la documentación de soldadura para obtener más información.

 135
Author: Matt Handy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-18 17:37:11

El error podría permanecer a pesar de que el frijol CDI es serializable:

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

Clase de ejemplo:

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

Asegúrese de que todos los @Interceptores también son seializables:

@Interceptor
@Transactional
public class TransactionInterceptor implements Serializable {
    ...
}
 19
Author: Tim,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-31 16:09:42

Debe ser serializable.

Ver esta respuesta.

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

Mejor, Anders

 6
Author: anders.norgaard,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-18 17:34:40

Make DemoBeans serializado

@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
Author: Mohd Kose Avase,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-12-07 04:19:16

También puede activar el comportamiento de pasivación de su frijol con la anotación:

@Stateful (pasivationcapable=true)

En este caso no es necesario implementar la interfaz serializable.

Saludos. Jorge

 2
Author: Jorge Torres,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-05 13:43:54

Verificar importaciones

(algunas veces netbeans usó otras de otras bibliotecas)

Ejemplo. importar javax.cara.vista.ViewScoped; cámbielo import javax.cara.frijol.Ver la imagen;

 1
Author: Fabian Pisani,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 02:18:54

Causado por: org.jboss.soldadura.salvedad.DeploymentException: WELD-000072: Bean declarando un alcance de pasivación debe ser capaz de pasivación. Frijol: Frijol Manejado [clase com.marcos.controlador.PersonaBean] con calificadores [@Default @ Named @ Any]


Lo resolví, aparentemente CDI, no reconocí el frijol, solo lo hice más explícito

@Named
@ViewScoped
public class PersonaBean  implements Serializable {
@Inject
private IPersonaService service;
public void registrar() {

    try {
        service.registrar(null);

    }catch (Exception e) {
        e.printStackTrace();
    }
  }
}

La solución para mí:

@Named ("PersonaBean")
@ViewScoped
public class PersonaBean  implements Serializable {
@Inject
private IPersonaService service;
public void registrar() {

    try {
        service.registrar(null);

    }catch (Exception e) {
        e.printStackTrace();
    }
  }
}
 0
Author: Marcos Chacaliaza Altamirano,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-21 04:59:02