if (cls != null) { // Don't try this for JSPs
Class<?> clas;
try {
clas = classLoader.loadClass(cls.getStringValue());
} catch (ClassNotFoundException e) {
throw new DeploymentException("AbstractWebModuleBuilder: Could not load servlet class: " + cls.getStringValue(), e);
}
addClass(classes, clas);
}
}
// Get all the listeners from the deployment descriptor
ListenerType[] listeners = webApp.getListenerArray();
for (ListenerType listener : listeners) {
FullyQualifiedClassType cls = listener.getListenerClass();
Class<?> clas;
try {
clas = classLoader.loadClass(cls.getStringValue());
} catch (ClassNotFoundException e) {
throw new DeploymentException("AbstractWebModuleBuilder: Could not load listener class: " + cls.getStringValue(), e);
}
addClass(classes, clas);
}
// Get all the filters from the deployment descriptor
FilterType[] filters = webApp.getFilterArray();
for (FilterType filter : filters) {
FullyQualifiedClassType cls = filter.getFilterClass();
Class<?> clas;
try {
clas = classLoader.loadClass(cls.getStringValue());
} catch (ClassNotFoundException e) {
throw new DeploymentException("AbstractWebModuleBuilder: Could not load filter class: " + cls.getStringValue(), e);
}
addClass(classes, clas);
}
// see https://issues.apache.org/jira/browse/GERONIMO-3421 .
// if the user has botched her classloader config (perhaps by
// not including a jar that her app needs) then ClassFinder
// will throw NoClassDefFoundError. we want to indicate that
// it's the user's error and provide a little context to help
// her fix it.
try {
return new ClassFinder(classes);
} catch (NoClassDefFoundError e) {
throw new DeploymentException("Classloader for " + webApp.getId() + "can't find " + e.getMessage(), e);
}
}