<div dir="ltr">Hello,<div><br></div><div>the NPE is present because the AdapterDeploymentContext is null, when using the WildFly Adapter.</div><div><br></div><div><div>I tried to deploy this example to WildFly:</div><div><a href="https://github.com/matzew/keycloak/tree/wildfly/project-integrations/aerogear-ups">https://github.com/matzew/keycloak/tree/wildfly/project-integrations/aerogear-ups</a></div>
<div><br></div><div>The &#39;auth-server&#39; works fine, and on the &#39;app&#39; I simply changed the used adapter:</div><div><a href="https://github.com/matzew/keycloak/commit/c3f5d687fdb02f164bb87b9459332063c60b78e5">https://github.com/matzew/keycloak/commit/c3f5d687fdb02f164bb87b9459332063c60b78e5</a></div>
<div><br></div><div>Now when I am deploying the app.war file, I am getting a NPE inside of the BootstrapListener:</div><div><br></div><div><br></div><div>Caused by: java.lang.NullPointerException</div><div><span class="" style="white-space:pre">        </span>at org.keycloak.example.BootstrapListener.contextInitialized(BootstrapListener.java:24)</div>
<div><span class="" style="white-space:pre">        </span>at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)</div><div><span class="" style="white-space:pre">        </span>at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:190)</div>
<div><span class="" style="white-space:pre">        </span>... 7 more</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span></div></div><div><br></div><div><br></div><div>
<br></div><div>Looking at the sources, I see that the Undertow/WildFly adapters do behave a bit different than the AS7 one.</div><div><br></div><div>A few observations, the AS7 adapter is not &#39;failing&#39; if the getConfigInputStream() returns null:</div>
<div><a href="https://github.com/keycloak/keycloak/blob/master/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java#L114-L119">https://github.com/keycloak/keycloak/blob/master/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java#L114-L119</a><br>
</div><div><br></div><div>The AS7 apdater also stashes the AdapterDeploymentContext on the servletContext:</div><div><a href="https://github.com/keycloak/keycloak/blob/master/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java#L121">https://github.com/keycloak/keycloak/blob/master/integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/KeycloakAuthenticatorValve.java#L121</a><br>
</div><div><br></div><div>This is not done by the WildFly/Undertow Adapter, which causes the NPE that Bruno and I are facing, when trying to deploy on WildFly</div><div><br></div><div><br></div><div>-Matthias</div><div><br>
</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 3, 2014 at 6:01 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Certainly Bill, I did the changes here:<br>
<a href="https://github.com/abstractj/aerogear-unifiedpush-server/commit/75e8318e4e5c60e0a2e4aa7cf9d27c75f98406ad" target="_blank">https://github.com/abstractj/aerogear-unifiedpush-server/commit/75e8318e4e5c60e0a2e4aa7cf9d27c75f98406ad</a><br>

<br>
Do I need to include any additional configuration? The NPE persists,<br>
probably because I missed something.<br>
<div class="HOEnZb"><div class="h5"><br>
On 2014-06-03, Bill Burke wrote:<br>
&gt; Maybe it is because the application is configured to use the AS7 adapter<br>
&gt; and not Wildfly adapter?!<br>
&gt;<br>
&gt; On 6/3/2014 9:39 AM, Bruno Oliveira wrote:<br>
&gt; &gt; Good morning,<br>
&gt; &gt;<br>
&gt; &gt; During UPS server deployment a NPE is raised with Wildfly — I understand<br>
&gt; &gt; that currently only EAP is supported.<br>
&gt; &gt;<br>
&gt; &gt; Specifically I&#39;m currently looking into this:<br>
&gt; &gt; <a href="https://github.com/keycloak/keycloak/blob/634f61281de16b60ca65668c3d7da9be9a78ad2d/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java#L16" target="_blank">https://github.com/keycloak/keycloak/blob/634f61281de16b60ca65668c3d7da9be9a78ad2d/project-integrations/aerogear-ups/app/src/main/java/org/keycloak/example/BootstrapListener.java#L16</a>.<br>

&gt; &gt;<br>
&gt; &gt; My poor attempt to fix was <a href="https://gist.github.com/abstractj/3b6fbdd1a0c81c17cbcb" target="_blank">https://gist.github.com/abstractj/3b6fbdd1a0c81c17cbcb</a>, but no luck.<br>
&gt; &gt; Is KeycloakServletExtension the place where should I look?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt;<br>
&gt; &gt; abstractj<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; keycloak-dev mailing list<br>
&gt; &gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt; --<br>
&gt; Bill Burke<br>
&gt; JBoss, a division of Red Hat<br>
&gt; <a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
&gt; _______________________________________________<br>
&gt; keycloak-dev mailing list<br>
&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
<br>
--<br>
<br>
abstractj<br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div>