1 Reply Latest reply on Sep 23, 2015 2:53 AM by Sylvain Bonnemaison

    Producer is not available in Arquillian process

    Sylvain Bonnemaison Newbie



      The project is using Arquillian 1.1.9-Final with Arquiillian GF Embedded 3.1 plugin and GF Embedded 4.1 as a manage container.


      While running a unit test with Arquillian using Glassfish embedded plugin, I get the following CDI error :

      2015-09-18 06:25:24,376 DEBUG | main | org.jboss.weld.Reflection
      sept. 18, 2015 6:25:24 AM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
      GRAVE: Exception during lifecycle processing
      org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Set<Locale> with qualifiers @SupportedLocales
        at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject protected com.MyClass(@SupportedLocales Set<Locale>)
        at com.MyClass.<init>(MyClass.java:0)


      Set<Locale> with qualifier @SupportedLocales is defined in a module deployed in the tested WebArchive. The Archive content is :



      This object is provided by a producer method located in <common-cdi> module. The same module provide CDI extension feature like ThreadScoped. This producer is not discovered by Weld during test startup and Weld does not discover beans from <commons-cdi> module. How is it possible? Can we provide CDI extension features and CDI bean in the same module ?


      @SupportedLocales is declares in <commons-cdi> with:

              ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD
      public @interface SupportedLocales {


      The producer is declared in <commons-cdi> with:

      public class I18NProducer {
          public Set<Locale> getSupportedLocales() {
              Set<Locale> supportedLocales;
              supportedLocales = new HashSet<Locale>();
              return supportedLocales;


      Is there something wrong in declaration ?