{"record":{"id":"d830d7906eff6982","repo":"quarkusio/quarkus","slug":"failed-to-create-an-instance-of-commonbean-cla","errorCode":null,"errorMessage":"Failed to create an instance of \" + CommonBean.class.getName() + \" loaded from \" + Thread.currentThread().getContextClassLoader()","messagePattern":"Failed to create an instance of \" \\+ CommonBean\\.class\\.getName\\(\\) \\+ \" loaded from \" \\+ Thread\\.currentThread\\(\\)\\.getContextClassLoader\\(\\)","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"integration-tests/gradle/src/main/resources/custom-filesystem-provider/custom-filesystem-provider/src/main/java/org/acme/fs/AcmeFileSystemProvider.java","lineNumber":32,"sourceCode":"import java.nio.file.Path;\nimport java.nio.file.attribute.BasicFileAttributes;\nimport java.nio.file.attribute.FileAttribute;\nimport java.nio.file.attribute.FileAttributeView;\nimport java.nio.file.spi.FileSystemProvider;\nimport java.util.Map;\nimport java.util.Set;\n\nimport org.acme.common.CommonBean;\n\npublic class AcmeFileSystemProvider extends FileSystemProvider {\n\n\tfinal CommonBean bean;\n\n\tpublic AcmeFileSystemProvider() {\n\t\ttry {\n\t\t\tbean = (CommonBean) Thread.currentThread().getContextClassLoader().loadClass(CommonBean.class.getName()).getDeclaredConstructor().newInstance();\n\t\t} catch (Exception e) {\n\t\t\tthrow new IllegalStateException(\"Failed to create an instance of \" + CommonBean.class.getName() + \" loaded from \" + Thread.currentThread().getContextClassLoader(), e);\n\t\t}\n\t}\n\t\n\t@Override\n\tpublic String getScheme() {\n\t\treturn \"acme\";\n\t}\n\n\t@Override\n\tpublic FileSystem newFileSystem(URI uri, Map<String, ?> env) throws IOException {\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic FileSystem getFileSystem(URI uri) {\n\t\treturn null;\n\t}\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/gradle/src/main/resources/custom-filesystem-provider/custom-filesystem-provider/src/main/java/org/acme/fs/AcmeFileSystemProvider.java#L14-L50","documentation":"Test-support guard in a gradle integration-test custom FileSystemProvider: reflectively instantiating CommonBean from the thread-context classloader failed (class not found/instantiable from that loader). This verifies classloading inside the custom provider; the input at fault is the TCCL-visible CommonBean class.","triggerScenarios":"Thrown at integration-tests/gradle/src/main/resources/custom-filesystem-provider/custom-filesystem-provider/src/main/java/org/acme/fs/AcmeFileSystemProvider.java:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure CommonBean and its dependencies are visible to the context classloader","Check the declared constructor of CommonBean is accessible and throws no exception"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}