apache/hadoop · critical · ServerException
S08
S08
Error message
Could not load service classes, {0} What it means
HttpFS Server loads its service class list by calling Configuration.getClasses() on the 'httpfs.services' and 'httpfs.services.ext' properties, then de-dups implementations by their Service interface. Error S08 ('Could not load service classes') wraps any RuntimeException escaping that load phase - in practice almost always a ClassNotFoundException raised by Configuration.getClasses() because a class named in those properties is not on the webapp classpath.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java:565
List<Service> list = new ArrayList<Service>();
loadServices(classes, list);
loadServices(classesExt, list);
//removing duplicate services, strategy: last one wins
for (Service service : list) {
if (map.containsKey(service.getInterface())) {
log.debug("Replacing service [{}] implementation [{}]", service.getInterface(),
service.getClass());
}
map.put(service.getInterface(), service);
}
list = new ArrayList<Service>();
for (Map.Entry<Class, Service> entry : map.entrySet()) {
list.add(entry.getValue());
}
return list;
} catch (RuntimeException ex) {
throw new ServerException(ServerException.ERROR.S08, ex.getMessage(), ex);
}
}
/**
* Initializes the list of services.
*
* @param services services to initialized, it must be a de-dupped list of
* services.
*
* @throws ServerException thrown if the services could not be initialized.
*/
protected void initServices(List<Service> services) throws ServerException {
for (Service service : services) {
log.debug("Initializing service [{}]", service.getInterface());
checkServiceDependencies(service);
service.init(this);
this.services.put(service.getInterface(), service);
}View on GitHub (pinned to 2add963021)
Solutions
- Check the chained cause - it names the exact class that failed to load
- Verify each class listed in httpfs.services/httpfs.services.ext exists on the webapp classpath (WEB-INF/lib or the httpfs tomcat lib directory)
- Fix or remove stale entries from the properties
- Redeploy a consistent set of jars (do not mix Hadoop versions) and restart
Example fix
<!-- before: httpfs.services references a class that no longer exists -->
<property><name>httpfs.services</name>
<value>org.apache.hadoop.lib.service.instrumentation.InstrumentationService,
com.myco.removed.OldService</value></property>
<!-- after -->
<property><name>httpfs.services</name>
<value>org.apache.hadoop.lib.service.instrumentation.InstrumentationService</value></property> Defensive patterns
Strategy: validation
Validate before calling
for (String name : config.getStrings("httpfs.services", new String[0])) {
Class.forName(name.trim()); // fails fast with ClassNotFoundException before server start
} Try / catch
try {
server.init();
} catch (ServerException ex) {
if (ex.getError() == ServerException.ERROR.S08) {
Throwable cause = ex.getCause(); // usually RuntimeException wrapping ClassNotFoundException
log.error("service class list failed to load: {}", cause, ex);
}
throw ex;
} Prevention
- Treat httpfs.services as code: update it in the same change that adds/removes a service jar
- Automate a pre-deploy check that Class.forName() succeeds for every listed class on the webapp classpath
- Never mix service jars from different Hadoop distributions
- Deploy jars and the services property together (atomic deployment)
When it happens
Trigger: Server startup calls getConfig().getClasses(getPrefixedName("services")) / ("services.ext"); a fully-qualified class name listed in httpfs.services or httpfs.services.ext cannot be loaded (missing jar, renamed class, typo), so getClasses throws a RuntimeException which is wrapped as S08.
Common situations: A jar was removed from share/hadoop/httpfs/tomcat/webapp/WEB-INF/lib but its class names remain in httpfs.services; a Hadoop upgrade renamed or moved a service class; a typo in the property value; duplicate/conflicting jars hiding the class.
Related errors
- S07
- Could not find configured fencing method {}
- "Unknown protocol: " + protocolName
- ${diskValidator} DiskValidator class not found.
- Could not load failover proxy provider class {} which is con
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/2a3d0421dc3c53e4.
Report an issue: GitHub.