-
Bug
-
Resolution: Done
-
Major
-
5.1.0.Final
-
None
The single
@ManagedBean public class BeanType{}
is bypassed on SeContainerInitializer.newInstance().initialize(), since the jakarta.annotation.@ManagedBean annotation(from weld-se-shaded-5.1.0.Final.jar!) is not included into 'final Set<Class<? extends Annotation>> beanDefiningAnnotations' of Weld.createDeployment(...), leading to 'WELD-ENV-002009: Weld SE container cannot be initialized - no bean archives found' startup crash.
Things become much better if @ManagedBean is replaced with something from the beanDefiningAnnotations set, e.g. @ApplicationScoped.
the https://docs.jboss.org/weld/reference/latest/en-US/html_single/#_managed_beans states "You can explicitly declare a managed bean by annotating the bean class @ManagedBean, but in CDI you don’t need to." @ManagedBean classes muzz be managed by Weld and so trigger isBeanArchive flag when framework scans their container.