quarkusio/quarkus · error · RuntimeException

Offending class is '${className}'

Error message

 Offending class is '${className}'

What it means

discoverLogComponents throws this RuntimeException when a @LoggingFilter annotated class does not (directly or transitively) implement java.util.logging.Filter. Only real Filter implementations can be registered as log filters, so the build fails with ILLEGAL_LOGGING_FILTER_USE_MESSAGE plus the offending class name.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java:382

            boolean isFilterImpl = false;
            ClassInfo currentClassInfo = classInfo;
            while ((currentClassInfo != null) && (!JandexUtil.DOTNAME_OBJECT.equals(currentClassInfo.name()))) {
                boolean hasFilterInterface = false;
                List<DotName> ifaces = currentClassInfo.interfaceNames();
                for (DotName iface : ifaces) {
                    if (FILTER.equals(iface)) {
                        hasFilterInterface = true;
                        break;
                    }
                }
                if (hasFilterInterface) {
                    isFilterImpl = true;
                    break;
                }
                currentClassInfo = index.getClassByName(currentClassInfo.superName());
            }
            if (!isFilterImpl) {
                throw new RuntimeException(
                        ILLEGAL_LOGGING_FILTER_USE_MESSAGE + " Offending class is '" + classInfo.name() + "'");
            }

            String filterName = instance.value("name").asString();
            if (filtersMap.containsKey(filterName)) {
                throw new RuntimeException("Filter '" + filterName + "' was defined multiple times.");
            }
            filtersMap.put(filterName, classInfo.name().toString());
        }
        if (!filtersMap.isEmpty()) {
            result.setNameToFilterClass(filtersMap);
        }

        return result;
    }

    @BuildStep(onlyIfNot = IsProduction.class)
    @Produce(TestSetupBuildItem.class)

View on GitHub (pinned to e1c734241f)

Solutions

  1. Make the annotated class implement java.util.logging.Filter directly.
  2. If it extends a base class, ensure the superclass chain actually implements java.util.logging.Filter and that the class is part of the indexed application.
  3. Check that the right Filter interface is imported (java.util.logging.Filter, not servlet or other Filter types).

Example fix

// before
@LoggingFilter(name = "my-filter")
public class MyFilter { }
// after
@LoggingFilter(name = "my-filter")
public class MyFilter implements java.util.logging.Filter {
    @Override
    public boolean isLoggable(LogRecord record) { return false; }
}
Defensive patterns

Strategy: validation

Validate before calling

if (!java.util.logging.Filter.class.isAssignableFrom(MyFilter.class)) {
    throw new IllegalStateException("Class with @LoggingFilter must implement java.util.logging.Filter");
}

Type guard

static boolean implementsJulFilter(Class<?> c) {
    return java.util.logging.Filter.class.isAssignableFrom(c);
}

Prevention

When it happens

Trigger: Placing @LoggingFilter(name="...") on a class whose hierarchy does not include java.util.logging.Filter; the build step walks the superclass chain via the Jandex index and fails when no Filter interface is found.

Common situations: Annotated class implements a similarly named but different Filter interface (e.g. jakarta.servlet.Filter or a custom one); refactoring removed the java.util.logging.Filter implementation from the hierarchy.

Related errors


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