ClassLoader classLoader = webModule.getEarContext().getClassLoader();
// Get all the servlets from the deployment descriptor
ServletType[] servlets = webApp.getServletArray();
for (ServletType servlet : servlets) {
FullyQualifiedClassType cls = servlet.getServletClass();
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());
}
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());
}
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());
}
addClass(classes, clas);
}
return new ClassFinder(classes);