Search code examples
keycloakactivemq-artemis

Javascript Error when using Keycloak with Artemis for Management Console access


I have mostly used the example here to set up Keycloak for Artemis 2.38.0 on the Hawtio management console, but I hit the following error on page load.

Uncaught Error: The 'Keycloak' constructor must be invoked with 'new'.
    at Keycloak (keycloak.js?_=1733507431806:769:16)
    at app-fafe513f4b.js:1:106123
    at Object.<anonymous> (app-fafe513f4b.js:1:106675)
    at l (lib-e53c220218.js:1:27075)
    at Object.fireWith [as resolveWith] (lib-e53c220218.js:1:27832)
    at l (lib-e53c220218.js:1:75611)
    at HTMLScriptElement.i (lib-e53c220218.js:1:80132)
    at HTMLScriptElement.dispatch (lib-e53c220218.js:1:39298)
    at HTMLScriptElement.<anonymous> (lib-e53c220218.js:1:37387)

This same issue is mentioned in this mail thread with no solution.

It is also mentioned here in Jira which states essentially "will not fix"

I was expecting it to not throw an error when visiting the console.

As a work around, I have successfully added my own side car with Ouath-proxy to hit Keycloak


Solution

  • The web console shipped in ActiveMQ Artemis 2.38.0 is going to be replaced in relatively short order with a new console implementation based on Hawtio 4+. This referenced in the Jira you cited.

    As far as I can tell the issue on the mailing list thread which you cited is that, for whatever reason, the user wasn't able to get the new console to work at all, not that it didn't necessarily work with the latest release of Keycloak. That said, I work with the new console all the time using these instructions to build and test it, and I haven't had any of the issues described on that mailing list thread. I recommend you give that a shot.