quarkusio/quarkus · error · IllegalStateException

${resource} not found on classpath

Error message

${resource} not found on classpath

What it means

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.

Source

Thrown at extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/SmallRyeOpenApiProcessor.java:1437

        IndexView getIndex();

    }

    @BuildStep
    void generateRestJsClient(
            SmallRyeOpenApiConfig openApiConfig,
            List<OpenApiDocumentBuildItem> openApiDocuments,
            BuildProducer<GeneratedStaticResourceBuildItem> staticResourceProducer) {

        if (!openApiConfig.jsClient().enabled()) {
            return;
        }

        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        for (String resource : List.of("rest/rest-client.js", "rest/rest-client.d.ts")) {
            try (InputStream is = tccl.getResourceAsStream(resource)) {
                if (is == null) {
                    throw new IllegalStateException(resource + " not found on classpath");
                }
                String fileName = resource.substring(resource.lastIndexOf('/') + 1);
                staticResourceProducer.produce(
                        new GeneratedStaticResourceBuildItem(
                                "/_static/quarkus-rest/" + fileName,
                                IoUtil.readBytes(is)));
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        for (OpenApiDocumentBuildItem doc : openApiDocuments) {
            if (!doc.isDefaultDocument()) {
                continue;
            }
            OpenAPI model = doc.getSmallRyeOpenAPI().model();
            String proxyJs = generateRestProxy(model);
            staticResourceProducer.produce(

View on GitHub (pinned to e1c734241f)

Solutions

  1. Restore/refresh the quarkus-smallrye-openapi deployment artifact: delete it from ~/.m2/repository and rebuild
  2. 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
  3. Rebuild the extension from source if using a locally built or proxied version

Example fix

// before (pom.xml filter excludes everything)
<exclude>*</exclude>
// after
<exclude>*.bak</exclude>
Defensive patterns

Strategy: validation

Validate before calling

boolean ok = List.of("rest/rest-client.js", "rest/rest-client.d.ts")
    .stream().allMatch(r -> getClass().getClassLoader().getResource(r) != null);

Try / catch

try { ...build... } catch (IllegalStateException e) { if (e.getMessage().endsWith("not found on classpath")) { reinstall the extension artifact; } throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/3f96fc5e6465625b. Report an issue: GitHub.