This discussion is archived
1 2 Previous Next 19 Replies Latest reply: Jul 20, 2013 3:54 PM by 68ffe0e3-44ff-42c6-9961-0bcf1edaf8da RSS

WL12c : CDI in complex ear deployment does not work

montanero Newbie
Currently Being Moderated
I'm migrating a JEE6 application from JBoss7 to WL12c (12.1.1.0) and getting the impression that CDI does not really work in combination wit WLs class loading.
Yes, I installed patch 13603813 and got rid of some issues, but some annoying problems remain.

In my scenario I have an .ear-deploment containing a collection of moduls (wars and ejb jars) and some shared library jars in lib/, which are adressed via MANIFEST classpathes.
The library jars contain CDI beans (yes, META-INF/beans.xml are provided), which are injected into the modules (META-INF/beans.xml at the appropriate places)

No matter what I do, Im getting org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies, though there is only one possible dependency.
Example

WELD-001409 Ambiguous dependencies for type [Lib1Class1] with qualifiers [@Default] at injection point [[field] @Inject private cditest.web.Access.lib1Class1]. Possible dependencies [[Managed Bean [class cditest.lib1.Lib1Class1] with qualifiers [@Any @Default], Managed Bean [class cditest.lib1.Lib1Class1] with qualifiers [@Any @Default]]]

I've tried the following so far:
- put the library jars in APP-INF/lib to bring them into the application class loader. Failed: It seems that its not possible to have bean archives in APP-INF/lib. Can't blame oracle for this, its a non-standard extension anyway.
- combining the module classloaders with weblogic-application.xml <classloader-structure>. Didn't change anything. That caught me by surprise.

I have condensed my problem tio a minimal project reproducing the bug. It seems that you need at least two ejb-jars, one war and one library jar containing one web bean, which is injected into the war and into one of the ejb-jars.

Sombody else having this problem? Suggestions?

If you're interested I can provide a minimal maven project . Any help is appreciated.

regards
roland

weblogic.management.DeploymentException:
     at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
     at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
     at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
...
Caused By: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [Lib1Class1] with qualifiers [@Default] at injection point [[field] @Inject private cditest.web.Access.lib1Class1]. Possible dependencies [[Managed Bean [class cditest.lib1.Lib1Class1] with qualifiers [@Any @Default], Managed Bean [class cditest.lib1.Lib1Class1] with qualifiers [@Any @Default]]]
     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:261)
     at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:105)
     at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:125)
     at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:324)
     at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:309)
     at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:361)
     at com.oracle.injection.provider.weld.WeldInjectionContainer.start(WeldInjectionContainer.java:105)
     at com.oracle.injection.integration.CDIAppDeploymentExtension.prepare(Unknown Source)
     at weblogic.application.internal.flow.AppDeploymentExtensionFlow.prepare(AppDeploymentExtensionFlow.java:23)
     at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:706)
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
     at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:237)
     at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
     at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
     at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
     at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
     at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:96)
     at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:229)
     at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
     at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
     at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
     at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
     at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points