2 Replies Latest reply on Jul 17, 2014 4:03 AM by Sven Panko

    Wildfly 8.1 honors AfterBeanDiscovery only in combination with ProcessAnnotatedType

    Sven Panko Newbie

      Hi all,


      I am observing a very strange behavior while trying to debug an application I am deploying to Wildfly 8.1. My application is packaged as an EAR and within the EAR's lib directory I have a simple jar file that contains a META-INF/services/javax.enterprise.inject.spi.Extension file that points to this class:


      public class JCacheExtension implements Extension
          private final Logger logger = LoggerFactory.getLogger(getClass());
        public void interceptProcessAnnotatedTypes(@Observes ProcessAnnotatedType processAnnotatedType)
             logger.info("*****: {}", processAnnotatedType.getAnnotatedType().getJavaClass());
        public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager)
           logger.warn("**** afterBeanDiscovery");


      If I deploy that class, I will get a log output for every annotated type and a final message for the afterBeanDiscovery event.


      If I remove the method interceptProcessAnnotatedType() I get NO OUTPUT AT ALL, i.e. the afterBeanDiscovery method output is no longer logged. If I run the server in debug mode from IntelliJ I can see that the method is executed and when stepping through it I get the output. Is there any specific reason why this is happening or is this a bug?


      Thanks in advance,