<div dir="ltr">Yep, I realized that after I sent the example.  I&#39;ll have to wait to get back to work to get the full example down to demo.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 4, 2013 at 4:39 AM, Martin Kouba <span dir="ltr">&lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">John, in fact the &quot;HandlerTest&quot; deployment archive is not a CDI<br>
deployment (final WAR does not contain a beans.xml file in its WEB-INF)<br>
and so the Weld is not started at all and CDIInjectionEnricher just<br>
fails (no BeanManager available).<br>
<br>
Also I wouldn&#39;t use the ShrinkWrap JavaArchive (return type of<br>
@Deployment method) if the default Arquillian protocol is &quot;Servlet 3.0&quot;<br>
and the resulting deployment will surely be WebArchive - IMHO it&#39;s not<br>
entirely clear what the structure of the resulting test deployment<br>
should be (in your test case the deployment is added to the WEB-INF/lib<br>
of the final deployment) and moreover Arquillian must do some more<br>
&quot;magic&quot; (e.g. for WebArchive the BeansXMLProtocolProcessor adds empty<br>
beans.xml to WEB-INF if the test deployment contains beans.xml but is<br>
not WebArchive).<br>
<br>
And finally I would also use<br>
ManifestContainer.addAsServiceProvider(Class&lt;?&gt;, Class&lt;?&gt;...) instead of<br>
addAsManifestResource() to add CDI extension...<br>
<br>
M<br>
<br>
Dne 4.7.2013 02:42, John D. Ament napsal(a):<br>
<div class="im">&gt; Ok, so I was able to reproduce my issue, but it doesn&#39;t match Aslak&#39;s case.<br>
&gt;<br>
&gt; <a href="https://github.com/johnament/cdifoo" target="_blank">https://github.com/johnament/cdifoo</a><br>
&gt;<br>
&gt; It&#39;s a very simple project.  I used AS7 as my deployment container.<br>
&gt;<br>
&gt; In one test, I use beans.xml to autoregister the archive.<br>
&gt; That passes fine.<br>
&gt;<br>
&gt; In the other test, I don&#39;t use a beans.xml, instead I use<br>
&gt;<br>
&gt; public void addHandlers(@Observes BeforeBeanDiscovery bbd,BeanManager<br>
&gt; beanManager) {<br>
&gt;<br>
&gt; to register the classes in my archive.  I even go the extra step of<br>
&gt; registering my interface and test case, just in case.<br>
&gt;<br>
&gt; Could you take a look at the project and let me know if you see<br>
&gt; something I did wrong?<br>
&gt;<br>
&gt; - John<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 2, 2013 at 9:46 AM, John D. Ament &lt;<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Yeah... Aslak&#39;s the one who brought this to my attention.  It was<br>
&gt;     something I saw happening in AS7 as well.  Let me see if I can<br>
&gt;     create a simple project that demos this.<br>
&gt;<br>
&gt;<br>
&gt;     On Tue, Jul 2, 2013 at 9:18 AM, Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a><br>
</div><div class="im">&gt;     &lt;mailto:<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         Yes, if you use @EJB, all bets are off :-) I was assuming John<br>
&gt;         had an EJB that he wanted to @Inject.<br>
&gt;<br>
&gt;         On 2 Jul 2013, at 14:13, Romain Manni-Bucau<br>
</div><div class="im">&gt;         &lt;<a href="mailto:rmannibucau@gmail.com">rmannibucau@gmail.com</a> &lt;mailto:<a href="mailto:rmannibucau@gmail.com">rmannibucau@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         &gt; Hi<br>
&gt;         &gt;<br>
&gt;         &gt; i think @EJB Foo&lt;Bar&gt; ignores Bar (or at least the ejb spec doesnt define it)<br>
&gt;         &gt;<br>
&gt;         &gt; Romain Manni-Bucau<br>
&gt;         &gt; Twitter: @rmannibucau<br>
&gt;         &gt; Blog: <a href="http://rmannibucau.wordpress.com/" target="_blank">http://rmannibucau.wordpress.com/</a><br>
&gt;         &gt; LinkedIn: <a href="http://fr.linkedin.com/in/rmannibucau" target="_blank">http://fr.linkedin.com/in/rmannibucau</a><br>
&gt;         &gt; Github: <a href="https://github.com/rmannibucau" target="_blank">https://github.com/rmannibucau</a><br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
</div>&gt;         &gt; 2013/7/2 Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a> &lt;mailto:<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;&gt;<br>
<div class="im">&gt;         &gt;<br>
&gt;         &gt; On 2 Jul 2013, at 11:28, John D. Ament &lt;<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a> &lt;mailto:<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a>&gt;&gt; wrote:<br>

&gt;         &gt;<br>
&gt;         &gt; &gt; Hi all<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; In section 4.2 of the CDI spec (both 1.0 and 1.1) there are references to injection around generic types.  I was wondering if someone could clarify this case?<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; I have an interface:<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; public interface Handler&lt;? extends Foo&gt; { ... }<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; and then I have two implementations<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; public class FarlowHandler implements Handler&lt;Farlow&gt; { .. }<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; public class BagelHandler implements Handler&lt;Bagel&gt; { ... }<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; Is it expected that I should be able to inject references to these by doing:<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; @Inject<br>
&gt;         &gt; &gt; private Handler&lt;Farlow&gt; fHandler;<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; @Inject<br>
&gt;         &gt; &gt; private Handler&lt;Bagel&gt; bHandler;<br>
&gt;         &gt;<br>
&gt;         &gt; Yes.<br>
&gt;         &gt;<br>
&gt;         &gt; &gt;<br>
&gt;         &gt; &gt; ?  Is there any expected difference when using EJBs?<br>
&gt;         &gt;<br>
&gt;         &gt; Assuming the interface is part of the local client view of the EJB, then no. Obviously, if EJB has any rules around declaring generic types in local interfaces, then you need to respect those (IIRC, it doesn&#39;t).<br>

&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; _______________________________________________<br>
&gt;         &gt; cdi-dev mailing list<br>
</div>&gt;         &gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a>&gt;<br>
&gt;         &gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<div class="HOEnZb"><div class="h5">&gt;         &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>