<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Inter-module injection - the easy way (or even any way or alternative approaches)?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/tom-jb">tom-jb</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/774712#774712">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I am trying unsuccessfully to get Inter-module injection working.  I expected that I could have a cdi-enabled war @Inject beans from a bean archive in the same container after haing added a dependency to the bean-archive-as-module in the war's jboss-deployment-structure.xml file</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My ultimate goal is to enable a rapid development process for our team where developers working on the front end redeploy just a lean war that does not contain any backend services but has a module dependency on a "services" deployable (which is currently an ear but could be just a jar if need be).  Devs doing front-end work would ideally just @Inject any local dependency located in the services deployable with minimal/zero per-service configuration fuss. The services deployable is a fairly time-consuming redeploy, and a frequent redeploy seems unneeded for developers just doing front-end work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Normally, I might have liked to accomplish this goal by using an exploded ear, where the war is part of the ear, and the front end developer can just redeploy the war portion of the ear after making,say, a java file change, and only the war is redeployed, not the entire ear (which again is slow and seemingly unneeded). Other apps servers that I've worked with in the past offer this specific functionality, but it appears that AS7 does not (unless, hopefully, I'm wrong). On AS7 it seems only the entire ear can be redeployed, even if just the war needs redeployment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>So, I am looking for alternative approaches to accomplish the same goal, such as using a front-end war external to the services deployable that uses inter-module injection (as described <a class="jive-link-external-small" href="http://docs.jboss.org/cdi/spec/1.0/html/injectionelresolution.html">here under 5.1.4</a> in the CDI spec). However when I try this, I get "unsatisfied dependencies" errors.  I think I'm satisfying the requirements for inter-module injection (though the 4th part is unclear to me - "<span style="color: #000000; font-family: 'Times New Roman'; font-size: medium; background-color: #ffffff;">the bean class is required to be accessible to classes in the module, according to the class accessibility requirements of the module architecture</span>"). I have confirmed that my war (which has a  reference in jboss-deployment-structure.xml to the ear module and to the ejb-jar subdeployment inside the ear) can do a jndi lookup for an example EJB using "java:global/my-ear.ear/my-ejb.jar/SomeService", but @Inject can not find the same bean. I'm confident that a have cdi enabled on both the war and on the ear (plus I've tried just a simple bean archive jar instead of my full-blown ear).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any workarounds or alternative approaches would be most welcome.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks all,</p><p>#Tom</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/774712#774712">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>