Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-31

CDI lookup behaviour changed in 7.0.0.DR1

XMLWordPrintable

      We have a test, which deploys an application containing the infinispan-embedded uberjar to EAP7. The test has a class with this method signature:

      @Produces
      @ApplicationScoped
      public EmbeddedCacheManager defaultCacheManager() {}
      

      During deployment, this error is thrown:

      15:58:25,036 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."test.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".WeldStartService: Failed to start service
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
      Exception 0 :
      org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type CacheContainer with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private org.infinispan.cdi.AdvancedCacheProducer.defaultCacheContainer
        at org.infinispan.cdi.AdvancedCacheProducer.defaultCacheContainer(AdvancedCacheProducer.java:0)
        Possible dependencies: 
        - Producer Method [EmbeddedCacheManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @ApplicationScoped public org.infinispan.cdi.test.cachemanager.embedded.external.Config.defaultCacheManager()],
        - Managed Bean [class org.infinispan.manager.DefaultCacheManager] with qualifiers [@Any @Default]
      

      This isn't happening with 6.6.0, and I'm not sure which behaviour is correct. The test class, AdvancedCacheProducer and DefaultCacheManager didn't change in 7.0.0 (with regards to CDI) as far as I can see.

            slaskawi@redhat.com Sebastian Ɓaskawiec (Inactive)
            jmarkos Jakub Markos (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: