0

I am deploying an ear on wildfly which contains the Extension DeltaspikeContextExtension. In my test directory, I used a Producer for this extension called DeltaspikeProducerDCE. I need this producer for my integration tests, because he cannot inject the original extension.

After building (successfully, including the integration tests) and deploying the ear, I start my Wildfly Server and get the following errors:

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type DeltaSpikeContextExtension with qualifiers @Default
..

at org.apache.deltaspike.core.impl.scope.viewaccess.ViewAccessContextArtifactProducer.deltaSpikeContextExtension(ViewAccessContextArtifactProducer.java:0)
  Possible dependencies: 
  - Extension [class org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension] with qualifiers [@Default]; torino-application.ear,
  - Producer Method [DeltaSpikeContextExtension] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @SessionScoped @Produces public ..ejb.api.registration.service.DeltaspikeProducerDCE.produce()]

I replaced the original package of the project with ... What could cause this behaviour?

The class DeltaspikeProducerDCE is located in src/test/java/../api.registration.service, which normally should be excluded from the ear.

I am using Eclipse Mars and Wildfly 10 and build via Maven.

EngJon
  • 987
  • 8
  • 20
  • The fact that you're adding a producer method is probably the root of your issue. Extensions are loaded at deployment time within CDI. They should not be manually looked up. Under what situation are you not able to inject it? – John Ament May 04 '16 at 11:54
  • I am starting an integration test with arquillian. The underlying tested class (which is injected in the integration test) seems to need that extension – EngJon May 04 '16 at 11:57
  • Ok, but how are you enabling the extension? Is it possible that its not enabled within your test classes' archive? – John Ament May 04 '16 at 11:58
  • I am not able to look into the project for a few days. I didn't configure it myself, so I can't tell how it is enabled for now. I will have a look though. Still, isn't it unusual that the producer gets deployed although it's in test? – EngJon May 04 '16 at 12:09
  • @JohnAment Hi again. The `apache-deltaspike.properties` is empty, so there is no further configuration I guess. Do you know how to enable the extensions for tests? – EngJon May 09 '16 at 08:56

0 Answers0