Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-19111

WAR subdeployment Bean/Interceptor visibility not bidirectional - not flat

XMLWordPrintable

    • Hide

      tar xfv weld-test.tgz

      cd weld-test

      mvn clean install -DskipTests

      cp app/target/app.war {WILDFLY-31}/standalone/deployments/

      server.log:

      16:36:11,683 ERROR [stderr]  java.lang.AssertionError
      16:36:11,691 ERROR [stderr]   at deployment.app.war//org.junit.Assert.assertFalse(Assert.java:75)
      16:36:11,693 ERROR [stderr]   at deployment.app.war//org.example.app.StartupBean.testBeanManagerProvider(StartupBean.java:48)
      16:36:11,695 ERROR [stderr]   at deployment.app.war//org.example.app.StartupBean.test(StartupBean.java:32)

       

      Show
      tar xfv weld-test.tgz cd weld-test mvn clean install -DskipTests cp app/target/app.war {WILDFLY-31}/standalone/deployments/ server.log: 16:36:11,683 ERROR [stderr]   java.lang.AssertionError 16:36:11,691 ERROR [stderr]   at deployment.app.war//org.junit.Assert.assertFalse(Assert.java:75) 16:36:11,693 ERROR [stderr]   at deployment.app.war//org.example.app .StartupBean.testBeanManagerProvider(StartupBean.java:48) 16:36:11,695 ERROR [stderr]   at deployment.app.war//org.example.app.StartupBean.test(StartupBean.java:32)  
    • ---
    • ---

      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());

              manovotn Matěj Novotný
              fruehbeck@aon.at Thomas Frühbeck (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: