-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
31.0.1.Final
-
-
---
-
---
Project structure: app.war/WEB-INF/lib/cdi.jar
beans.xml: enabled Interceptor
Injected BeanManager#resolveInterceptors successfully resolves Interceptor in app.
cdi.jar: BeanManagerProvider resolves BeanManger by CDI.current().getBeanManager()
Weld SE:
cdi.jar#BeanMangerProvider#CDI.current()#getBeanManager() is able to resolve Interceptor
Wildfly-31:
The cdi.jar#BeanMangerProvider#CDI.current()#getBeanManager() is NOT able to resolve Interceptor!
See: StartupBean#testBeanManagerProvider:
List<Interceptor<?>> interceptors =
bm.resolveInterceptors(InterceptionType.AROUND_INVOKE, new AnnotationLiteral<MyInterceptor>() {});
// Verify correctly enabled Interceptor:
Assert.assertFalse(interceptors.isEmpty());
BeanManagerProvider bmProvider = getContextual(bm, BeanManagerProvider.class);
interceptors =
InterceptorLookup.lookupInterceptors(bmProvider.getCurrent(), new AnnotationLiteral<MyInterceptor>() {});
// Will fail on Wildfly-31:
Assert.assertFalse(interceptors.isEmpty());