quarkusio/quarkus · error · java.lang.IllegalStateException

Unable to create resolver:

Error message

Unable to create resolver: 

What it means

EngineProducer.createResolver wraps all reflective instantiation failures (ClassNotFoundException, InstantiationException, NoSuchMethodException, SecurityException, etc.) into this IllegalStateException while creating a resolver configured via quarkus.qute.resolver.*.classes. The original exception is attached as the cause.

Source

Thrown at extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java:369

        return engine;
    }

    void onShutdown(@Observes ShutdownEvent event) {
        // Make sure to clear the Qute cache
        Qute.clearCache();
    }

    private Resolver createResolver(String resolverClassName) {
        try {
            Class<?> resolverClazz = Thread.currentThread()
                    .getContextClassLoader().loadClass(resolverClassName);
            if (Resolver.class.isAssignableFrom(resolverClazz)) {
                return (Resolver) resolverClazz.getDeclaredConstructor().newInstance();
            }
            throw new IllegalStateException("Not a resolver: " + resolverClassName);
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException
                | InvocationTargetException | NoSuchMethodException | SecurityException e) {
            throw new IllegalStateException("Unable to create resolver: " + resolverClassName, e);
        }
    }

    private TemplateGlobalProvider createGlobalProvider(String initializerClassName) {
        try {
            Class<?> initializerClazz = Thread.currentThread()
                    .getContextClassLoader().loadClass(initializerClassName);
            if (TemplateGlobalProvider.class.isAssignableFrom(initializerClazz)) {
                return (TemplateGlobalProvider) initializerClazz.getDeclaredConstructor().newInstance();
            }
            throw new IllegalStateException("Not a global provider: " + initializerClazz);
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException
                | InvocationTargetException | NoSuchMethodException | SecurityException e) {
            throw new IllegalStateException("Unable to create global provider: " + initializerClassName, e);
        }
    }

    private boolean isExcluded(String path) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the chained cause (ClassNotFoundException vs NoSuchMethodException vs constructor exception) to identify the exact failure.
  2. Correct the fully-qualified class name in quarkus.qute.resolver.<n>.classes.
  3. Ensure the class has a public no-arg constructor and its dependencies are on the runtime classpath.
  4. For native builds, verify reflection registers the class (or that it is reachable via Quarkus config-driven registration).

Example fix

// before
quarkus.qute.resolver.x.classes=com.example.MyResolvr // typo
// after
quarkus.qute.resolver.x.classes=com.example.MyResolver
Defensive patterns

Strategy: validation

Validate before calling

try { Class.forName("com.example.MyResolver", true, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IllegalStateException("Resolver class not on classpath", e); }

Try / catch

try { app.start(); } catch (IllegalStateException e) { if (e.getMessage().startsWith("Unable to create resolver")) { log.error("Check cause", e.getCause()); } else throw e; }

Prevention

When it happens

Trigger: A quarkus.qute.resolver.<n>.classes value names a class that is missing from the classpath, is abstract/an interface, lacks a public no-arg constructor, or whose constructor throws.

Common situations: Typo in the fully-qualified class name; the class lives in a module/extension not included in the build; constructor dependency missing at runtime; native-image build missed reflection registration for the class.

Related errors


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