{"record":{"id":"fc97ccea0b7279c0","repo":"quarkusio/quarkus","slug":"unable-to-find-the-following-conversion-class-c","errorCode":null,"errorMessage":"Unable to find the following conversion class: ${customConversion}","messagePattern":"Unable to find the following conversion class: (.+?)","errorType":"exception","errorClass":"CodeGenException","httpStatus":null,"severity":"error","filePath":"extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java","lineNumber":78,"sourceCode":"        compiler.setTemplateDir(templateDirectory);\n        compiler.setStringType(options.stringType);\n        compiler.setFieldVisibility(SpecificCompiler.FieldVisibility.PRIVATE);\n        compiler.setCreateOptionalGetters(options.createOptionalGetters);\n        compiler.setGettersReturnOptional(options.gettersReturnOptional);\n        compiler.setOptionalGettersForNullableFieldsOnly(options.optionalGettersForNullableFieldsOnly);\n        compiler.setCreateSetters(options.createSetters);\n        compiler.setEnableDecimalLogicalType(options.enableDecimalLogicalType);\n        compiler.setOutputCharacterEncoding(\"UTF-8\");\n        compiler.addCustomConversion(Conversions.UUIDConversion.class);\n\n        for (String customConversion : options.customConversions) {\n            try {\n                Class<?> conversionClass = Class.forName(customConversion);\n                if (!conversionClass.isInstance(Conversions.UUIDConversion.class)) {\n                    compiler.addCustomConversion(conversionClass);\n                }\n            } catch (ClassNotFoundException e) {\n                throw new CodeGenException(\"Unable to find the following conversion class: \" + customConversion, e);\n            }\n        }\n\n        try {\n            compiler.compileToDestination(file, outputDirectory.toFile());\n        } catch (IOException e) {\n            throw new CodeGenException(\"Failed to copy compiled files to output directory \" +\n                    outputDirectory.toAbsolutePath(), e);\n        }\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":90,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/avro/deployment/src/main/java/io/quarkus/avro/deployment/AvroSchemaCodeGenProvider.java#L60-L90","documentation":"The Avro code-gen accepts custom conversion classes (quarkus.avro.codegen.custom-conversions). Each configured class name is loaded with Class.forName at build time; if the class is not on the build classpath, this CodeGenException is thrown. Note the check conversionClass.isInstance(Conversions.UUIDConversion.class) is inverted-looking, but the thrown error only concerns the class not being found.","triggerScenarios":"quarkus.avro.codegen.custom-conversions lists a class name that is misspelled, in a module not on the compile classpath, or removed in a dependency upgrade.","commonSituations":"Typo in fully-qualified class name; conversion class lives in a test or optional dependency not visible to the deployment build; package renamed after an Avro/Quarkus upgrade.","solutions":["Fix the fully-qualified class name in quarkus.avro.codegen.custom-conversions","Add the artifact containing the conversion class as a compile-scope dependency of the application","Confirm the class is public with a public no-arg constructor and implements org.apache.avro.Conversion","Rebuild after dependency changes (mvn clean install) so the updated classpath is used"],"exampleFix":"// before\nquarkus.avro.codegen.custom-conversions=com.example.MyConversion\n// class actually at com.example.avro.MyConversion\n// after\nquarkus.avro.codegen.custom-conversions=com.example.avro.MyConversion","handlingStrategy":"validation","validationCode":"String cls = \"com.example.avro.MyConversion\";\ntry {\n    Class<?> c = Class.forName(cls);\n    if (!org.apache.avro.Conversion.class.isAssignableFrom(c)) {\n        throw new IllegalArgumentException(cls + \" is not an org.apache.avro.Conversion\");\n    }\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Conversion class not on classpath: \" + cls);\n}","typeGuard":null,"tryCatchPattern":"try {\n    project.build();\n} catch (CodeGenException e) {\n    if (e.getCause() instanceof ClassNotFoundException cnfe) {\n        log.error(\"Check quarkus.avro.codegen.custom-conversions entries: \" + cnfe.getMessage());\n    }\n    throw e;\n}","preventionTips":["Use fully-qualified class names exactly as in source (watch package renames)","Keep conversion classes in a compile-scope module","Verify class is public with a public no-arg constructor","Run mvn dependency:tree to confirm the artifact is on the build classpath"],"tags":["avro","codegen","classpath","reflection","quarkus"],"backgroundTag":"classnotfound-classpath","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"}