BeeInventor / keycloak-cognito-migration

A Keycloak UserStorageProvider for migrating users from AWS Cognito
MIT License
19 stars 5 forks source link

Support for Keycloak 17 (Quarkus) #1

Closed Xi0s closed 2 years ago

Xi0s commented 2 years ago

Currently when adding the built provider .jar file into the new /opt/keycloak/provider/ folder as part of Quarkus build it causes an error:

#15 4.244 2022-02-28 13:39:28,700 WARN  [org.keycloak.services] (build-71) KC-SERVICES0047: cognito-migration (com.beeinventor.keycloak.CognitoMigrationResourceProviderFactory) is implementing the internal SPI realm-restapi-extension. This SPI is internal and may change without notice
#15 4.704 ERROR: Failed to run 'build' command.
#15 4.704 ERROR: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
#15 4.704       [error]: Build step io.quarkus.deployment.index.ApplicationArchiveBuildStep#build threw an exception: java.lang.NullPointerException
#15 4.704       at org.jboss.jandex.FieldInternal.hashCode(FieldInternal.java:99)
#15 4.704       at org.jboss.jandex.StrongInternPool.hash(StrongInternPool.java:152)
#15 4.704       at org.jboss.jandex.StrongInternPool.intern(StrongInternPool.java:237)
#15 4.704       at org.jboss.jandex.NameTable.intern(NameTable.java:117)
#15 4.704       at org.jboss.jandex.ClassInfo.setFields(ClassInfo.java:745)
#15 4.704       at org.jboss.jandex.Indexer.index(Indexer.java:1993)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:123)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:92)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:56)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep$2.apply(ApplicationArchiveBuildStep.java:313)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep$2.apply(ApplicationArchiveBuildStep.java:309)
#15 4.704       at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.handleJarPath(ApplicationArchiveBuildStep.java:309)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.createApplicationArchive(ApplicationArchiveBuildStep.java:213)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.scanForOtherIndexes(ApplicationArchiveBuildStep.java:154)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.build(ApplicationArchiveBuildStep.java:105)
#15 4.704       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
#15 4.704       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
#15 4.704       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
#15 4.704       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
#15 4.704       at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
#15 4.704       at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
#15 4.704       at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
#15 4.704       at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
#15 4.704       at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
#15 4.704       at java.base/java.lang.Thread.run(Thread.java:829)
#15 4.704       at org.jboss.threads.JBossThread.run(JBossThread.java:501)
#15 4.704 
#15 4.704 ERROR: Build failure: Build failed due to errors
#15 4.704       [error]: Build step io.quarkus.deployment.index.ApplicationArchiveBuildStep#build threw an exception: java.lang.NullPointerException
#15 4.704       at org.jboss.jandex.FieldInternal.hashCode(FieldInternal.java:99)
#15 4.704       at org.jboss.jandex.StrongInternPool.hash(StrongInternPool.java:152)
#15 4.704       at org.jboss.jandex.StrongInternPool.intern(StrongInternPool.java:237)
#15 4.704       at org.jboss.jandex.NameTable.intern(NameTable.java:117)
#15 4.704       at org.jboss.jandex.ClassInfo.setFields(ClassInfo.java:745)
#15 4.704       at org.jboss.jandex.Indexer.index(Indexer.java:1993)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:123)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:92)
#15 4.704       at io.quarkus.deployment.index.IndexingUtil.indexJar(IndexingUtil.java:56)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep$2.apply(ApplicationArchiveBuildStep.java:313)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep$2.apply(ApplicationArchiveBuildStep.java:309)
#15 4.704       at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.handleJarPath(ApplicationArchiveBuildStep.java:309)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.createApplicationArchive(ApplicationArchiveBuildStep.java:213)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.scanForOtherIndexes(ApplicationArchiveBuildStep.java:154)
#15 4.704       at io.quarkus.deployment.index.ApplicationArchiveBuildStep.build(ApplicationArchiveBuildStep.java:105)
#15 4.704       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
#15 4.704       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
#15 4.704       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
#15 4.704       at java.base/java.lang.reflect.Method.invoke(Method.java:566)
#15 4.704       at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
#15 4.704       at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
#15 4.704       at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
#15 4.704       at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
#15 4.704       at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
#15 4.704       at java.base/java.lang.Thread.run(Thread.java:829)
#15 4.704       at org.jboss.threads.JBossThread.run(JBossThread.java:501)
#15 4.704 
kevinresol commented 2 years ago

This is an issue from the Haxe compiler: https://github.com/HaxeFoundation/haxe/issues/10608

I am still using wildfly and with the newly released v1.5.1 the warnings (yes they are warnings in wildfly and not fatal) are gone. Can you please try it with Quarkus?

Xi0s commented 2 years ago

Confirmed this fixes the issue, thanks!