EJB injection in Servlet with glassfish4
<p>I have a servlet class, that worked fine with glassfish3 and Java-7.</p>

<p>The ear contains these resources:</p>

<ul>
<li>x.ear

<ul>
<li>x.war</li>
<li>x-interface.jar</li>
<li>x-ejb.jar</li>
</ul></li>
</ul>

<p>The Servlet inside the war file looks like this:</p>

<pre><code>@Path("/X")
@ManagedBean
public class XWebservice {

    @EJB
    SessionBeanRemoteInterface bean;

    @GET
    public String get() {
        return bean.sessionBeanMethod();
    }
}
</code></pre>

<p>The bean inside the ejb-jar looks like this:</p>

<pre><code>@Stateless
public class XBean implements SessionBeanRemoteInterface {
}
</code></pre>

<p>Why does this not work in glassfish 4.1.1 using Java-8 anymore? (NullPointerException, bean is null)</p>

<p>Manual lookup, however works fine:</p>

<pre><code>new InitialContext().lookup(SessionBeanRemoteInterface.class.getName()).sessionBeanMethod();
</code></pre>