<!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;">
    Re: 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/774854#774854">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Thanks much for your response and alternative productivity tip, JRebel. JRebel is a great tool , and I am already using it, but it only goes so far, and still requires redeploy for a variety of circumstances. Further, I'd like to find a solution for the team and the community at large that doesn't require a tool such JRebel, since not all folks and teams can obtain or manage use of JRebel.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Nicklas Karlsson wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The CDI spec statement has an implied "<span style="color: #000000; font-family: 'Times New Roman'; font-size: medium; background-color: #ffffff;">according to the class accessibility requirements of the module architecture of the Java EE specification</span>". Even if the classloading could be configured in an AS to do some special trick, CDI has the visibility rules of a standard EE app (EAR/WAR/JAR). </p></blockquote><p>What you characterize as a "special trick", I might characterize as a "useful application of the wonderful JBoss module system" <span> :) </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It sounds like you are saying based on this spec that EARs, WARs, and even JARs should not have class visibility from say, another war.&#160; If that is true, then it seems like the Inter-module injection part of the spec can never be satisfied in any useful way, since that class accessibility requirement can never be satisfied. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Also, I can sort of understand this tight accessibility restriction for EARs and WARs, but surely just JAR deployables are accessible by other deployables, since jar deployable are basically the same as a module. I thought there was even a concept of a "bean archive" jar that other deployables can take advantage. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Also, I'm a bit surprised that such an action is considered violating the visibility rules, since the classes are accessible.visible via jndi lookup and via Class.forName().&#160; Unless I'm missing something, it seems like an inconsistency then that one can then currently do an @EJB("java:/global/my-ejb-jar.jar/SomeBean") but not do a simpler @Inject instead. The classes are clearly accessible from a jndi lookup perspective and and a Class.forName() perspective, but not accessible from a CDI @Inject perspective. From inside the war, I'm even able to use the BeanManager instance from the dependent jar to do getBeans() on beans from the dependent jar to get at a jar bean, but not with @Inject. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Assuming there is no such solution, might it be possible to roll my own solution using a CDI hook/extension? If I am able to hook into the CDI bean resolution logic in the front-end war (I haven't studied if/how this can be done), then I would be able to lookup across the module using the technique that I have working described above where I have a bridge into the dependent jar exposing that deployable's BeanManager.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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/774854#774854">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>