{"record":{"id":"1dd08db905188da9","repo":"quarkusio/quarkus","slug":"failed-to-process-configuration-of-config-getid","errorCode":null,"errorMessage":"Failed to process configuration of ${config.getId()} registry: failed to cast ${providerValue} to String","messagePattern":"Failed to process configuration of (.+?) registry: failed to cast (.+?) to String","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java","lineNumber":151,"sourceCode":"            if (provider != null) {\n                final URL url;\n                try {\n                    url = new URL((String) provider);\n                } catch (MalformedURLException e) {\n                    throw new IllegalStateException(\"Failed to translate \" + provider + \" to URL\", e);\n                }\n                return loadFromUrl(url);\n            }\n            return getDefaultClientFactory();\n        }\n\n        public RegistryClientFactory loadFromArtifact(RegistryConfig config, final Object providerValue) {\n            ArtifactCoords providerArtifact;\n            try {\n                final String providerStr = (String) providerValue;\n                providerArtifact = ArtifactCoords.fromString(providerStr);\n            } catch (Exception e) {\n                throw new IllegalStateException(\"Failed to process configuration of \" + config.getId()\n                        + \" registry: failed to cast \" + providerValue + \" to String\", e);\n            }\n            final File providerJar;\n            try {\n                providerJar = artifactResolver.resolve(new DefaultArtifact(providerArtifact.getGroupId(),\n                        providerArtifact.getArtifactId(), providerArtifact.getClassifier(),\n                        providerArtifact.getType(), providerArtifact.getVersion())).getArtifact().getFile();\n            } catch (BootstrapMavenException e) {\n                throw new IllegalStateException(\n                        \"Failed to resolve the registry client factory provider artifact \" + providerArtifact, e);\n            }\n            log.debug(\"Loading registry client factory for %s from %s\", config.getId(), providerArtifact);\n            final URL url;\n            try {\n                url = providerJar.toURI().toURL();\n            } catch (MalformedURLException e) {\n                throw new IllegalStateException(\"Failed to translate \" + providerJar + \" to URL\", e);\n            }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java#L133-L169","documentation":"Thrown by ExtensionCatalogResolver.loadFromArtifact when the configured registry client-factory artifact value cannot be processed as a String containing valid artifact coordinates — either the configured value is not a String or it does not parse via ArtifactCoords.fromString. The registry id and offending value are included in the message.","triggerScenarios":"Configuring a registry's client-factory provider with a non-String object (e.g. a number/map in YAML/properties) or with a string that is not valid G:A[:C][:T]:V coordinates, causing the cast or ArtifactCoords.fromString to throw.","commonSituations":"YAML config where a value like 1.0.0 is parsed as a float, so the (String) cast fails; coordinate string missing the version; using a path or URL instead of Maven coordinates.","solutions":["Quote the value in YAML/properties so it is treated as a String (e.g. \"1.0.0\")","Provide full Maven coordinates groupId:artifactId:classifier:type:version for the client factory jar","Verify the coordinate string parses with ArtifactCoords.fromString locally","Point the config at the correct registry client factory artifact"],"exampleFix":"// before (YAML)\nregistries:\n  my-registry:\n    client-factory: 1.0.0\n// after\nregistries:\n  my-registry:\n    client-factory: \"io.quarkus.registry:quarkus-registry-client-factory:1.0.0\"","handlingStrategy":"type-guard","validationCode":"Object providerValue = ...;\n// Validate it is a String and parses as artifact coordinates before configuring\nif (providerValue instanceof String s) {\n    ArtifactCoords.fromString(s); // throws if invalid; catch and report early\n} else {\n    throw new IllegalArgumentException(\"client-factory must be a string of G:A:C:T:V coordinates\");\n}","typeGuard":"boolean isValidProvider(Object v) {\n    if (!(v instanceof String s)) return false;\n    try { ArtifactCoords.fromString(s); return true; } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    resolver.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"failed to cast\") || e.getMessage().contains(\"Failed to process configuration of\")) {\n        // quote the YAML value or supply full G:A:C:T:V coordinates per the message\n    }\n    throw e;\n}","preventionTips":["Quote numeric-looking values in YAML/properties configs so they parse as strings","Provide full groupId:artifactId:classifier:type:version coordinates","Validate registry client-factory config at startup with ArtifactCoords.fromString"],"tags":["configuration","registry","type-cast"],"backgroundTag":"invalid-registry-config","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}