quarkusio/quarkus · error · IllegalStateException
Cannot load required type: <requiredType>
Error message
Cannot load required type: <requiredType>
What it means
Thrown by ConfigPropertyCreator.create when Class.forName(requiredType, true, cl) fails for the type recorded at build time in the synthetic bean's parameters. The requiredType string was captured during deployment from the injection point's config property type; at runtime the thread-context classloader (falling back to the creator's own loader) cannot load that class, meaning the class was reachable at build time but is missing from the runtime classpath — usually caused by a dependency scope change or class relocation between build and run.
Source
Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigPropertyCreator.java:25
import io.quarkus.arc.BeanCreator;
import io.quarkus.arc.SyntheticCreationalContext;
import io.quarkus.arc.impl.InjectionPointProvider;
import io.smallrye.config.inject.ConfigProducerUtil;
public class ConfigPropertyCreator implements BeanCreator<Object> {
@Override
public Object create(SyntheticCreationalContext<Object> context) {
String requiredType = context.getParams().get("requiredType").toString();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = ConfigPropertyCreator.class.getClassLoader();
}
try {
Class.forName(requiredType, true, cl);
} catch (ClassNotFoundException e) {
throw new IllegalStateException("Cannot load required type: " + requiredType);
}
InjectionPoint injectionPoint = InjectionPointProvider.getCurrent(context);
if (injectionPoint == null) {
throw new IllegalStateException("No current injection point found");
}
ConfigStaticInitCheckInterceptor.recordConfigValue(injectionPoint, null);
try {
return ConfigProducerUtil.getValue(injectionPoint, ConfigProvider.getConfig());
} catch (Exception e) {
throw new DeploymentException(e);
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Verify the artifact containing the property type is a runtime dependency, not compile-only or deployment-only
- Check for class relocation or removal between the build-time and runtime artifacts of the affected extension
- Confirm no custom classloader isolation excludes the class from the application runtime classpath
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigPropertyCreator.java:25 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/5e36a326987a7b73.
Report an issue: GitHub.