quarkusio/quarkus · error · java.lang.IllegalStateException

Not a global provider:

Error message

Not a global provider: 

What it means

EngineProducer.createGlobalProvider loads the class configured via quarkus.qute.global-provider.<n>.classes and verifies it implements io.quarkus.qute.TemplateGlobalProvider. If it loads but does not, startup fails with this error. Note the message appends the loaded Class object, so it prints class <FQN> rather than the raw config string.

Source

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

                    .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) {
        for (Pattern p : templatePathExcludes) {
            if (p.matcher(path).matches()) {
                return true;
            }
        }
        return false;
    }

    private Optional<TemplateLocation> locate(String path) {
        if (isExcluded(path)) {
            return Optional.empty();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Make the configured class implement io.quarkus.qute.TemplateGlobalProvider with a public no-arg constructor.
  2. Fix the quarkus.qute.global-provider.<n>.classes property to the correct FQN.
  3. Remove the property if you provide globals another way (e.g. @TemplateGlobal annotated classes need no config).

Example fix

// before
quarkus.qute.global-provider.g.classes=com.example.SomeResolver
// after
quarkus.qute.global-provider.g.classes=com.example.MyGlobals // implements TemplateGlobalProvider
Defensive patterns

Strategy: validation

Validate before calling

Class<?> c = Class.forName("com.example.MyGlobals");
if (!io.quarkus.qute.TemplateGlobalProvider.class.isAssignableFrom(c)) throw new IllegalArgumentException("Not a TemplateGlobalProvider");

Type guard

boolean isGlobalProvider(Class<?> c) { return io.quarkus.qute.TemplateGlobalProvider.class.isAssignableFrom(c); }

Try / catch

try { app.start(); } catch (IllegalStateException e) { if (e.getMessage().contains("Not a global provider")) { /* fix quarkus.qute.global-provider config */ } else throw e; }

Prevention

When it happens

Trigger: Setting quarkus.qute.global-provider.<n>.classes to a class that exists but does not implement TemplateGlobalProvider (e.g. mistakenly pointing it at a Resolver or a plain bean).

Common situations: Confusing the resolver and global-provider config keys; renaming/refactoring a class so it no longer implements the interface; copying config from an example with a different class.

Related errors


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