WELD-000411--"just" a warning,

WARN  [org.jboss.weld.Event] (MSC service thread 1-2) WELD-000411: Observer method [BackedAnnotatedMethod] protected org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension.vetoBeans(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.


12:19:17,318 WARN  [org.jboss.weld.Event] (MSC service thread 1-2) WELD-000411: Observer method [BackedAnnotatedMethod] protected org.apache.deltaspike.core.impl.message.MessageBundleExtension.detectInterfaces(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.


12:19:17,335 WARN  [org.jboss.weld.Event] (MSC service thread 1-2) WELD-000411: Observer method [BackedAnnotatedMethod] protected org.apache.deltaspike.core.impl.interceptor.GlobalInterceptorExtension.promoteInterceptors(@Observes ProcessAnnotatedType<Object>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.



By default, CDI capable containers attempt to register every single class in JARs in  /WEB-INF/lib as a CDI managed bean. In older CDI versions as used by older Java EE 6 containers, there were bugs whereby the CDI implementation even attempts to register enums, abstract classes and/or classes without a default constructor, resulting in deployment exceptions (WebLogic), runtime exceptions (WebSphere) and/or loads of confusing warnings (GlassFish/TomEE).


In order to solve that, OmniFaces added a VetoAnnotatedTypeExtension which should "veto" any class from org.omnifaces package which is not in either org.omnifaces.cdi or org.omnifaces.showcase subpackage from being registered as a CDI managed bean. This happens via ProcessAnnotatedType#veto().


In Weld 2.x as used in WildFly, there's apparently a new type of warning which occurs when you use ProcessAnnotatedType on all classes. However, in this specific case, it's just the whole purpose to scan every single class, because classes which needs to be excluded from being registered as CDI managed beans are obviously not explicitly registered as a CDI managed bean (for which you could otherwise use a more specific T or @WithAnnotations as suggested in the warning message).


Theoretically, the solution in this specific case would be to use <weld:include> or <weld:exclude> in beans.xml instead of an Extension. However, this is not a standard CDI solution as this is Weld-specific and thus wouldn't work with other CDI implementations such as OpenWebBeans or CanDI. We couldn't figure a similar mechanism for other CDI implementations, so we went for the Extension. After all, this is "just" a warning, not an error. Everything should continue to work as intented.


你可能感兴趣的:(WELD-000411--"just" a warning,)