<font size=2 face="sans-serif">Thank you for the prompt replies. <br>
<br>
In answer to your question. It is UiSnapshotData which gets injected under
OWB. <br>
<br>
Regards<br>
Benjamin</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Martin Kouba <mkouba@redhat.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">Matej Novotny <manovotn@redhat.com>,
Benjamin Confino/UK/IBM@IBMGB, </font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">Emily Jiang/UK/IBM@IBMGB,
Tom Evans/UK/IBM@IBMGB, weld-dev@lists.jboss.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">29/11/2016 07:42</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [weld-dev]
Specializes bean in war causes unsatisfied resolution exception</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Matej is correct. The specializing bean from the war
disables the <br>
specialized bean from ear/lib. And since the bean from war is not <br>
visible to the bean from ear/lib (KinderzuschussKinderServiceImpl) an <br>
unsatisfied dependency exists.<br>
<br>
By the way, what instance of SnapshotData gets injected into <br>
KinderzuschussKinderServiceImpl for OWB? Is it UiSnapshotData from the
<br>
war/lib?<br>
<br>
Martin<br>
<br>
Dne 29.11.2016 v 07:06 Matej Novotny napsal(a):<br>
> Hello Benjamin<br>
><br>
> Thanks for well written question!<br>
><br>
>> (You can see the application at was_bugs/was_bug22 at master ·<br>
>> thikade/was_bugs · GitHub )<br>
><br>
> Thanks! Took a glance and it looks like the infamous EAR visibility
issue.<br>
><br>
>> My first thought was that this application should not work<br>
><br>
> I agree with that. Anything located in EAR/lib cannot really "see"
into WAR.<br>
> Hence the bean with @Specializes (in WAR) will disable the original
bean (in EAR/lib) and the injection cannot be performed as<br>
> the specialized bean is not visible to the archive in EAR/lib.<br>
><br>
>> I confirmed that this application works fine on OpenWebBeans.<br>
><br>
> The fact that it does NOT work should be in accord with Java EE spec
and its visibility restrictions.<br>
> Maybe you should be asking OWB guys why does it work at all?<br>
><br>
> I am no EAR expert but I really think this is Java EE spec (not CDI)
intended behavior.<br>
><br>
> Matej<br>
><br>
> ----- Original Message -----<br>
>> From: "Benjamin Confino" <BENJAMIC@uk.ibm.com><br>
>> To: weld-dev@lists.jboss.org<br>
>> Cc: "Tom Evans" <TEVANS@uk.ibm.com>, "Emily
Jiang" <EMIJIANG@uk.ibm.com><br>
>> Sent: Monday, November 28, 2016 4:56:12 PM<br>
>> Subject: [weld-dev] Specializes bean in war causes unsatisfied
resolution
exception<br>
>><br>
>> 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<br>
>> from the other ear/lib jar file<br>
>><br>
>> And there is a class inside the ear/war/WEB-INF/lib jar file that<br>
>> @Specializes the bean inside an ear/lib jar file<br>
>><br>
>> (You can see the application at was_bugs/was_bug22 at master ·<br>
>> thikade/was_bugs · GitHub )<br>
>><br>
>> Attempting to run this application on Weld results in an Unsatisfied<br>
>> Resolution Exception. When I remove the jar containing the @Specializes
bean<br>
>> the application works correctly.<br>
>><br>
>><br>
>> My first thought was that this application should not work, because
the war<br>
>> file and it's internal jar would have a second classloader that
would be<br>
>> invisible to the application classloader. However the customer
attested, and<br>
>> 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<br>
>> and got the same error.<br>
>><br>
>><br>
>> So it seems that Weld throws an Unsatisfied Resolution Exception
if<br>
>> @specializes exists in a class that is loaded by a classloader
which is not<br>
>> visible .<br>
>><br>
>> What do you think is the correct behaviour is in this instance?
>From a<br>
>> classloading perspective a class inside ear/lib should not be
able to see a<br>
>> class inside ear/war; but on the other hand the entire purpose
of a<br>
>> @Specializes bean is that you drop it into your application and
it replaces<br>
>> the original bean. It feels appropriate that you can drop in a
war file<br>
>> containing the @Specializes bean and it just works without you
having to do<br>
>> anything extra.<br>
>><br>
>> Best regards<br>
>> Benjamin<br>
>><br>
>> Unless stated otherwise above:<br>
>> IBM United Kingdom Limited - Registered in England and Wales with
number<br>
>> 741598.<br>
>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU<br>
>><br>
>> _______________________________________________<br>
>> weld-dev mailing list<br>
>> weld-dev@lists.jboss.org<br>
>> </font></tt><a href="https://lists.jboss.org/mailman/listinfo/weld-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/weld-dev</font></tt></a><tt><font size=2><br>
><br>
> _______________________________________________<br>
> weld-dev mailing list<br>
> weld-dev@lists.jboss.org<br>
> </font></tt><a href="https://lists.jboss.org/mailman/listinfo/weld-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/weld-dev</font></tt></a><tt><font size=2><br>
><br>
<br>
</font></tt>
<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>