<table width=1608 style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=1606 style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:1px 1px;"><font size=2 color=#4f4f4f face="Ubuntu">Hello
<br>
<br>
A customer of mine sent in a test application with the following structure:<br>
<br>
A war file inside ear<br>
Two jar files inside ear/lib<br>
One jar file inside ear/war/WEB-INF/lib<br>
<br>
There is a class inside one of the ear/lib jar files which @Injects a bean
from the other ear/lib jar file<br>
<br>
And there is a class inside the ear/war/WEB-INF/lib jar file that @Specializes
the bean inside an ear/lib jar file <br>
<br>
(You can see the application at was_bugs/was_bug22 at master · thikade/was_bugs
· GitHub ) <br>
<br>
Attempting to run this application on Weld results in an Unsatisfied Resolution
Exception. When I remove the jar containing the @Specializes bean the application
works correctly.<br>
<br>
<br>
My first thought was that this application should not work, because the
war file and it's internal jar would have a second classloader that would
be invisible to the application classloader. However the customer attested,
and I confirmed that this application works fine on OpenWebBeans. <br>
<br>
I do not think this is an integration issue, because I tested this on Wildfly
and got the same error.<br>
<br>
<br>
So it seems that Weld throws an Unsatisfied Resolution Exception if @specializes
exists in a class that is loaded by a classloader which is not visible
. <br>
<br>
What do you think is the correct behaviour is in this instance? From a
classloading perspective a class inside ear/lib should not be able to see
a class inside ear/war; but on the other hand the entire purpose of a @Specializes
bean is that you drop it into your application and it replaces the original
bean. It feels appropriate that you can drop in a war file containing the
@Specializes bean and it just works without you having to do anything extra.<br>
<br>
Best regards<br>
Benjamin </font><font size=2 face="Ubuntu">&nbsp;</font></table>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>