Hello,
the NPE is present because the AdapterDeploymentContext is null, when using the WildFly Adapter.
I tried to deploy this example to WildFly:
The 'auth-server' works fine, and on the 'app' I simply changed the used adapter:
Now when I am deploying the app.war file, I am getting a NPE inside of the BootstrapListener:
Caused by: java.lang.NullPointerException
at org.keycloak.example.BootstrapListener.contextInitialized(BootstrapListener.java:24)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:190)
... 7 more
Looking at the sources, I see that the Undertow/WildFly adapters do behave a bit different than the AS7 one.
A few observations, the AS7 adapter is not 'failing' if the getConfigInputStream() returns null:
The AS7 apdater also stashes the AdapterDeploymentContext on the servletContext:
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
-Matthias