quarkusio/quarkus · error · IllegalStateException

Improper integration of '${LogFilterFactory.class.getName()}

Error message

Improper integration of '${LogFilterFactory.class.getName()}' detected

What it means

ArcLogFilterFactory.create loads the named filter class and looks it up in the ArC container; if the container has no bean instance available for that class, it concludes the logging-filter-to-CDI integration was done incorrectly and throws this IllegalStateException. A @LogFilter class must be a discoverable CDI bean managed by ArC.

Source

Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/logging/ArcLogFilterFactory.java:20

import java.util.logging.Filter;

import io.quarkus.arc.Arc;
import io.quarkus.arc.InstanceHandle;
import io.quarkus.runtime.logging.LogFilterFactory;

/**
 * Creates the implementation of the class by getting a bean from Arc.
 * This class is loaded automatically by the {@link java.util.ServiceLoader}.
 */
public class ArcLogFilterFactory implements LogFilterFactory {

    @Override
    public Filter create(String className) throws Exception {
        InstanceHandle<?> instance = Arc.requireContainer().instance(Class.forName(className, true, Thread.currentThread()
                .getContextClassLoader()));
        if (!instance.isAvailable()) {
            throw new IllegalStateException("Improper integration of '" + LogFilterFactory.class.getName() + "' detected");
        }
        return (Filter) instance.get();
    }

    @Override
    public int priority() {
        return LogFilterFactory.DEFAULT_PRIORITY - 100;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Annotate the filter class with a bean-defining annotation (e.g. @ApplicationScoped) so ArC turns it into a bean
  2. Verify the class name passed to create() matches the filter class exactly
  3. Ensure the class is not excluded from bean discovery (no beans.xml/exclusion filters removing it)
  4. Rebuild the application so the container indexes the filter class

Example fix

// before
public class MyLogFilter implements Filter { ... }
// after
@ApplicationScoped
public class MyLogFilter implements Filter { ... }
Defensive patterns

Strategy: validation

Validate before calling

Class<?> filterClass = Class.forName(className, true, tccl);
boolean isBean = Arc.container() != null
        && Arc.container().instance(filterClass).isAvailable();
if (!isBean) throw new IllegalStateException(className + " is not a CDI bean; add a bean-defining annotation");

Try / catch

try {
    Filter f = factory.create(className);
} catch (IllegalStateException e) {
    logger.error("Make the log filter a discoverable CDI bean (@ApplicationScoped)", e);
}

Prevention

When it happens

Trigger: Registering a log filter class name via the LogFilterFactory mechanism where the target class is not a CDI bean in the ArC container (not annotated/discovered as a bean, excluded via build item, or in a non-bean archive).

Common situations: Filter class placed in a package excluded from bean discovery; missing bean-defining annotation; class present but removed from the container by build-time exclusion; wrong class name string passed to create().

Related errors


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