Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9326

Keycloak quickstarts throw NullPointerException when accessing service first time

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Done
    • fuse-7.1
    • fuse-7.2
    • Examples, Karaf
    • % %
    • Fuse 7.2 Sprint 35

    Description

      This can be reproduced for example with keycloak-httpservice quickstart . Prepare the quickstart following the Readme for default profile and then access http://localhost:8181/info in browser. There will be NullPointerException in browser and in karaf log:

      2018-08-20 10:51:31,545 | ERROR | XNIO-8 task-1        | i.u.request                      | 32 - io.undertow.core - 1.4.18.SP7-redhat-1 | UT005023: Exception handling request to /info
      java.lang.NullPointerException: null
      	at org.keycloak.adapters.PreAuthActionsHandler.preflightCors(PreAuthActionsHandler.java:108) ~[225:org.keycloak.keycloak-adapter-core:4.2.1.Final]
      	at org.keycloak.adapters.PreAuthActionsHandler.handleRequest(PreAuthActionsHandler.java:79) ~[225:org.keycloak.keycloak-adapter-core:4.2.1.Final]
      	at org.keycloak.adapters.undertow.ServletPreAuthActionsHandler.handleRequest(ServletPreAuthActionsHandler.java:68) ~[233:org.keycloak.keycloak-undertow-adapter:4.2.1.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[32:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [33:io.undertow.servlet:1.4.18.SP7-redhat-1]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:330) [32:io.undertow.core:1.4.18.SP7-redhat-1]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812) [32:io.undertow.core:1.4.18.SP7-redhat-1]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
      	at java.lang.Thread.run(Thread.java:748) [?:?]

      When I try to access the same url for a second time, everything works as expected.

      The error happens in these quickstarts:

      • keycloak-httpservice
      • keycloak-whiteboard
      • keycloak-whiteboard-blueprint
      • keycloak-war

      Attachments

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              jkasztur@redhat.com Jan Kasztura (Inactive)
              Jan Kasztura Jan Kasztura (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: