title: NullPointerException When Upgrading From Spring Boot 2.5.6 to 2.6.2 - Incompatibility With Wildfly
body: <p>We are upgrading a Spring Boot App deployed on Wildfly from Spring Boot 2.5.6 to 2.6.2. The majority of the app is working fine. However, we see the following stack trace on several URL's. One example is the CXF page listing web services which worked fine on Spring Boot 2.5.6.</p>
  <pre><code>2022-01-12 08:02:08,130 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-2) Forwarding to error page from request [/webservices] due to exception [HandlerMapping exception not suppressed]: java.lang.IllegalStateException: HandlerMapping exception not suppressed
      at org.springframework.web.servlet.handler.HandlerMappingIntrospector.doWithMatchingMappingIgnoringException(HandlerMappingIntrospector.java:220)
      at org.springframework.web.servlet.handler.HandlerMappingIntrospector.getCorsConfiguration(HandlerMappingIntrospector.java:161)
      at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:86)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  ....
  Caused by: java.lang.NullPointerException
  at io.undertow.servlet@2.0.27.Final//io.undertow.servlet.spec.HttpServletRequestImpl.getHttpServletMapping(HttpServletRequestImpl.java:250)
  </code></pre>
  <p>I set the CXF libraries to be the same at the previous version. I was wondering if people were seeing similar issues and what is the source of the difference.</p>
  <p>UPDATE #1</p>
  <hr />
  <p>I researched further and found what appears to be come incompatibility between Spring web classes and the implementation within Undertow packaged with Wildfly. I tried several Wildfly version with the following results:</p>
  <ul>
  <li>Wildfly 18.0.1 : NullPointerException shown above</li>
  <li>Wildfly 23.0.2 : NullPointerException shown above</li>
  <li>Wildfly 24.0.1 : no issues</li>
  <li>Wildfly 26.0.0 : no issues</li>
  <li>Redhat EAP 7.4 : NullPointerException shown above</li>
  </ul>
  <p>I further researched by exchanging the Undertow versions under the modules folder.</p>
  <ul>
  <li>Wildfly 18.0.1 / Undertow 2.0.27.Final  : NullPointerException</li>
  <li>Wildfly 23.0.2 / Undertow 2.2.5.Final  : NullPointerException</li>
  <li>Wildfly 24.0.1 / Undertow 2.2.8.Final  : no issues</li>
  <li>Wildfly 26.0.0 / Undertow 2.2.14.Final : no issues</li>
  <li>Redhat EAP 7.4 / Undertow 2.2.5.Final-redhat-00001  : NullPointerException</li>
  </ul>
  <p>If I move undertow files under /modules folder for Wildfly 24.0.1 to Wildfly 23.0.2 or Redhat EAP 7.4, the system deploys and runs with no issues when I access the url.So it appears the issue was addressed in Undertow between 2.2.5 and 2.2.8.</p>
  <p>So it appears that our clients are limited on upgrading their systems. Especially our clients who utilize Redhat EAP version, they will have to wait for an update.</p>
  <p>UPDATE #2</p>
  <hr />
  <p>After looking at the release notes for Undertow, the problem appears to be <a href="https://issues.redhat.com/browse/UNDERTOW-1866" rel="nofollow noreferrer">https://issues.redhat.com/browse/UNDERTOW-1866</a></p>