[jboss-jira] [JBoss JIRA] (WFLY-8168) Inter-application depdendency injection failure

Stuart Douglas (JIRA) issues at jboss.org
Sun Mar 12 19:43:00 EDT 2017


     [ https://issues.jboss.org/browse/WFLY-8168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart Douglas resolved WFLY-8168.
----------------------------------
    Resolution: Rejected


This is not a supported feature, CDI is scoped to a deployment, if you want to use CDI across multiple deployments your best bet is to package them up in an EAR.

> Inter-application depdendency injection failure
> -----------------------------------------------
>
>                 Key: WFLY-8168
>                 URL: https://issues.jboss.org/browse/WFLY-8168
>             Project: WildFly
>          Issue Type: Bug
>          Components: CDI / Weld
>    Affects Versions: 10.1.0.Final
>            Reporter: Daniel Huss
>            Assignee: Stuart Douglas
>         Attachments: inter-app-dependency.zip
>
>
> I was trying to implement a simple use case:
> * There's some service.ear providing a _Service_
> * service.ear has a module alias _ModuleAlias_
> * There are add-ons to _Service _that are dynamically deployed as jar files that depend on _ModuleAlias_ via manifest entries
> * The add-ons register/unregister themselves with _Service_ on deployment/undeployment
> The [CDI Reference|https://docs.jboss.org/author/display/WFLY10/CDI+Reference] states that we can depend on other deployments, so this seemed to be the easiest way to get the job done with JEE.
> The registration-on-deployment thing would look like this: 
> {code}
>    public void register(@Observes @Initialized(ApplicationScoped.class) Object init, AddonContext context)
>     {
>         context.register(this);
>     }
> {code}
> All I get is "WELD-001408: Unsatisfied dependencies". 
> So I've created a minimalistic example of the inter-app dependency scenario. See attachment. I've tried moving around module-alias, CDI annotations.... it just won't work.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list