{"record":{"id":"3f96fc5e6465625b","repo":"quarkusio/quarkus","slug":"resource-not-found-on-classpath","errorCode":null,"errorMessage":"${resource} not found on classpath","messagePattern":"(.+?) not found on classpath","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java","lineNumber":1437,"sourceCode":"        IndexView getIndex();\n\n    }\n\n    @BuildStep\n    void generateRestJsClient(\n            SmallRyeOpenApiConfig openApiConfig,\n            List<OpenApiDocumentBuildItem> openApiDocuments,\n            BuildProducer<GeneratedStaticResourceBuildItem> staticResourceProducer) {\n\n        if (!openApiConfig.jsClient().enabled()) {\n            return;\n        }\n\n        ClassLoader tccl = Thread.currentThread().getContextClassLoader();\n        for (String resource : List.of(\"rest/rest-client.js\", \"rest/rest-client.d.ts\")) {\n            try (InputStream is = tccl.getResourceAsStream(resource)) {\n                if (is == null) {\n                    throw new IllegalStateException(resource + \" not found on classpath\");\n                }\n                String fileName = resource.substring(resource.lastIndexOf('/') + 1);\n                staticResourceProducer.produce(\n                        new GeneratedStaticResourceBuildItem(\n                                \"/_static/quarkus-rest/\" + fileName,\n                                IoUtil.readBytes(is)));\n            } catch (IOException e) {\n                throw new UncheckedIOException(e);\n            }\n        }\n\n        for (OpenApiDocumentBuildItem doc : openApiDocuments) {\n            if (!doc.isDefaultDocument()) {\n                continue;\n            }\n            OpenAPI model = doc.getSmallRyeOpenAPI().model();\n            String proxyJs = generateRestProxy(model);\n            staticResourceProducer.produce(","sourceCodeStart":1419,"sourceCodeEnd":1455,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java#L1419-L1455","documentation":"The processor generates Dev UI static assets rest-client.js and rest-client.d.ts for the REST client. It reads them from the classpath; if either resource is missing from the deployment classpath, it throws IllegalStateException because the bundled asset was not packaged.","triggerScenarios":"Building with a modified/filtered deployment jar where META-INF resources rest/rest-client.js or rest/rest-client.d.ts were excluded; corrupted quarkus-smallrye-openapi deployment artifact; resource filtering stripping files from the jar.","commonSituations":"Custom Maven resource excludes or shade plugin filtering; a broken/partially-downloaded extension artifact in ~/.m2; tampering with the deployment jar in an internal artifact repository.","solutions":["Restore/refresh the quarkus-smallrye-openapi deployment artifact: delete it from ~/.m2/repository and rebuild","Check your build configuration (maven-shade/resource excludes, artifact filters) so rest/rest-client.js and rest/rest-client.d.ts are not filtered out","Rebuild the extension from source if using a locally built or proxied version"],"exampleFix":"// before (pom.xml filter excludes everything)\n<exclude>*</exclude>\n// after\n<exclude>*.bak</exclude>","handlingStrategy":"validation","validationCode":"boolean ok = List.of(\"rest/rest-client.js\", \"rest/rest-client.d.ts\")\n    .stream().allMatch(r -> getClass().getClassLoader().getResource(r) != null);","typeGuard":null,"tryCatchPattern":"try { ...build... } catch (IllegalStateException e) { if (e.getMessage().endsWith(\"not found on classpath\")) { reinstall the extension artifact; } throw e; }","preventionTips":["Do not filter resources out of extension deployment jars in shade/resource config","Verify artifact integrity after downloading through proxies/mirrors","Refresh ~/.m2 copies of quarkus-smallrye-openapi when classpath assets go missing"],"tags":["classpath","devui","build"],"backgroundTag":"missing-classpath-resource","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"}