1 Reply Latest reply on Jul 19, 2011 3:20 PM by Antti Laisi

    CDI Portable Extensions + JBoss AS7 issue

    Cleverson Sacramento Newbie

      Hi,

       

       

      We've run into some issues using CDI Portable Extensions and JBoss AS7. At first we've created a simple Webapp using CDI. The only source code (https://github.com/zyc/jboss-as7-lab) was a Bean (MyBean.java) and a class (MyExtension.java) that implements javax.enterprise.inject.spi.Extension.

       

      At MyExtension, we had 3 observers for CDI events that print a message in the console: BeforeBeanDiscovery, ProcessAnnotatedType, AfterDeploymentValidation.

       

      When trying to deploy the application on JBoss AS7, we've got no messages log on console seeming that the CDI events has not been raised. The same app works fine on JBoss AS6 with the following results on console:

       

      starting

      processing annoted type public class examples.MyExtension

      processing annoted type public class examples.MyBean

      started

       

      However if we create a CDI jar with another bean (MyAnotherBean.java) and include it in the webapp as a dependency we've got another unexpected behavior. The bean inside the jar is found and the messages are like the following:

       

      starting

      processing annoted type public class examples.MyAnotherBean

      started

       

      Deploying the same app on JBoss AS6 everything works as expected and the app output is shown:

       

      starting

      processing annoted type public class examples.MyAnotherBean

      processing annoted type public class examples.MyExtension

      processing annoted type public class examples.MyBean

      started

       

      Are we missing something in the container's config?

       

       

      Best regards,

       

      Cleverson Sacramento

      Wilson Guimarães

        • 1. Re: CDI Portable Extensions + JBoss AS7 issue
          Antti Laisi Newbie

          Beans.xml is in the wrong place in the webapp. Should be WEB-INF/beans.xml instead of WEB-INF/classes/META-INF/beans.xml.

           

          22:16:50,582 INFO  [stdout] (MSC service thread 1-2) starting
          22:16:50,616 INFO  [stdout] (MSC service thread 1-2) processing annoted type public class examples.MyExtension
          22:16:50,617 INFO  [stdout] (MSC service thread 1-2) processing annoted type public class examples.MyBean
          22:16:50,631 INFO  [stdout] (MSC service thread 1-2) processing annoted type public class examples.MyAnotherBean
          22:16:50,667 INFO  [stdout] (MSC service thread 1-2) started