junit-team/junit5 · error · JUnitException
Failed to read contents of ${reference}.
Error message
Failed to read contents of ${reference}. What it means
Error "Failed to read contents of ${reference}." thrown in junit-team/junit5.
Source
Thrown at junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java:269
* Scan module reference for classes that potentially contain testable methods.
*/
List<Class<?>> scan(ModuleReference reference) {
try (ModuleReader reader = reference.open()) {
try (Stream<String> names = reader.list()) {
// @formatter:off
return names.filter(name -> !name.endsWith("/")) // remove directories
.map(Path::of)
.filter(SearchPathUtils::isClassOrSourceFile)
.map(SearchPathUtils::determineFullyQualifiedClassName)
.filter(classFilter::match)
.<Class<?>> map(this::loadClassUnchecked)
.filter(classFilter::match)
.toList();
// @formatter:on
}
}
catch (IOException e) {
throw new JUnitException("Failed to read contents of " + reference + ".", e);
}
}
/**
* Load class by its binary name.
*
* @see ClassLoader#loadClass(String)
*/
private Class<?> loadClassUnchecked(String binaryName) {
try {
return classLoader.loadClass(binaryName);
}
catch (ClassNotFoundException e) {
throw new JUnitException("Failed to load class with name '" + binaryName + "'.", e);
}
}
}View on GitHub (pinned to 956246301e)
When it happens
Trigger: Thrown at junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java:269 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of junit-team/junit5@956246301e (2026-08-04).
Data as JSON: /data/errors/176a62bc970b5573.json.
Report an issue: GitHub.