<!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="http://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: Implementing a non-flat deployment for Weld Integration
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/flavia.rainone%40jboss.com">Flavia Rainone</a> in <i>JBoss Microcontainer Development POJO Server</i> - <a href="http://community.jboss.org/message/561400#561400">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><blockquote class="jive-quote"><p>Flavia Rainone wrote:</p><br/><p>We are not. I need to enable scanning of libs referenced by the manifest of deployed jars. The same goes for libs referenced by the manifest of lib jars (if any).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p></blockquote><p>With the help of Ales, I learned that ArchiveFilesDeployer should already receive the manifest referenced classpath of deployed jars in the line flagged below:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">    <font color="navy"><b>public</b></font> <font color="navy"><b>void</b></font> deploy(VFSDeploymentUnit unit, JBossWeldMetaData deployment) <font color="navy"><b>throws</b></font> DeploymentException
     <font color="navy">{</font>
>>>>>    Iterable<VirtualFile> classpaths = getClassPaths(unit);
         <font color="navy"><b>for</b></font> (VirtualFile cp : classpaths)
         <font color="navy">{</font>
            VirtualFile wbXml = cp.getChild(<font color="red">"META-INF/beans.xml"</font>);
            <font color="navy"><b>if</b></font> (wbXml.exists())
            <font color="navy">{</font>
               <font color="darkgreen">// add url</font>
               wbFiles.add(wbXml);
               <font color="darkgreen">// add classes</font>
               cpFiles.add(cp);
            <font color="navy">}</font>
         <font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>That means that we shouldn't have to do any work on the weld-int side to make it work. Despite that, I didn't manage to make a 100% working example.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I removed SentenceParser class from weld-translator.jar (the same used by testsuite deployers/weld) and added that class to a weld-translator-lib.jar. Then, I tried the following alternatives:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>- I first put weld-translator-lib.jar in /home/fla and referenced that jar from weld-translator.jar manifest file, with a series of ../:</p><p>Class-Path: ../../../weld-translator-lib.jar</p><p>VFSUtils.addManifestLocations correctly recognizes the jar, but WeldFilesDeployer receives a classpath like $JBOSS_HOME/server/all/deploy/weld-translator.jar/home/fla/weld-translator-lib.jar, which does not exist</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>- I decided to get rid of the .. in the classpath and added weld-translator-lib.jar to server/all/deploy. The weld-translator.jar manifest classpath refers now to weld-translator-lib.jar, as in the attached file</p><p>  That one works (i.e., no deployment errors). However, it does not work 100% correctly, because the </p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>if</b></font> (wbXml.exists())
</code></pre><p>statement above (when checking for weld-translator-lib.jar/META-INF/beans.xml) returns false, when it should return true</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>- finally, I tested the attached weld-translator.ear file, that contains weld-translator-lib.jar, and whose weld-translator.jar archive references that lib jar from its manifest. It doesn't work either. This time, VFSUtils.addManifestLocations recognizes the referenced jar, but the WeldFilesDeployer piece of code I pasted above does not get the extra classpath entry $JBOSS_HOME/server/all/deploy/weld-translator.ear/weld-translator-lib.jar. The outcome is the following deployment exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">15:50:42,482 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to
Start: name=vfs:///home/fla/Development/projects/jbossas-trunkLATEST/build/target/jboss-6.0.0-SNAPSHOT/
server/all/deploy/weld-translator.ear_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException:
WELD-001408 Unsatisfied dependencies for type [SentenceParser] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject org.jboss.test.deployers.weld.translator.ejb.TextTranslator(SentenceParser)]
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:294)
</code></pre></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/561400#561400">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Microcontainer Development POJO Server at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2116">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>