OK, <br>in CDI it&#39;s disallowed by spec:<br>&quot; 5.4.1.Unproxyable bean types<br>Certain legal bean types cannot be proxied by the container:<br>•classes which don&#39;t have a non-private constructor with no parameters,<br>
•classes which are declared final or have final methods<br><br>If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the<br> container automatically detects the problem and treats it as a deployment problem.&quot;<br>
<br>Anyway, the NPE in Seam2 is misleading. A cglib exception is swallowed. Correct?<br><br>Michael<br><br><br><div class="gmail_quote">2010/6/3 Michael Schütz <span dir="ltr">&lt;<a href="mailto:michaelschuetz83@gmail.com">michaelschuetz83@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi to all,<br><br>in Seam2, using injected member within final method will cause an NPE at Runtime. The reason for that is, that Seam2 uses cglib for dynamic proxying und subclassing is not possible for final methods.<br>
<br>
Example:<br>@Name(&quot;simpleSeamComp&quot;)<br>public class SimpleSeamComponent {<br>    public String getName() {<br>        return &quot;Sam&quot;;<br>    }<br>}<br><br>@Name(&quot;finalSeamComp&quot;)<br>public class FinalSeamComponent {<br>

<br>    @In(create = true)<br>    private SimpleSeamComponent simpleSeamComp;<br><br>    // causes NullPointerException<br>    public final String getHello() {<br>        return simpleSeamComp.getName();<br>    }<br>}<br>

<br><br>How will Seam3/CDI behave in that case?<br><br><br><br>Thanks and regards<br><font color="#888888">
Michael<br><br>
</font></blockquote></div><br>