Class clazz;
try {
clazz = classLoader.loadClass(className);
remoteClients.add(clazz);
AnnotationFinder annotationFinder = createFinder(clazz);
buildAnnotatedRefs(client, annotationFinder, classLoader);
} catch (ClassNotFoundException e) {
/**
* Some ClientModule are discovered only because the jar uses a Main-Class
* entry in the MANIFEST.MF file. Lots of jars do this that are not used as
* java ee application clients, so lets not make this a failure unless it
* has a META-INF/application-client.xml which tells us it is in fact
* expected to be a ClientModule and not just some random jar.
*/
if (clientModule.getAltDDs().containsKey("application-client.xml")) {
getValidationContext().fail("client", "client.missingMainClass", className);
} else {
getValidationContext().warn("client", "client.missingMainClass", className);
}
}
}
for (String rawClassName : clientModule.getRemoteClients()) {
final String className = realClassName(rawClassName);
Class clazz;
try {
clazz = classLoader.loadClass(className);
remoteClients.add(clazz);
} catch (ClassNotFoundException e) {
throw new OpenEJBException("Unable to load RemoteClient class: " + className, e);
}
AnnotationFinder annotationFinder = createFinder(clazz);
buildAnnotatedRefs(client, annotationFinder, classLoader);
}
for (String rawClassName : clientModule.getLocalClients()) {
final String className = realClassName(rawClassName);
Class clazz;
try {
clazz = classLoader.loadClass(className);
} catch (ClassNotFoundException e) {
throw new OpenEJBException("Unable to load LocalClient class: " + className, e);
}
AnnotationFinder annotationFinder = createFinder(clazz);
buildAnnotatedRefs(client, annotationFinder, classLoader);
}
validateRemoteClientRefs(classLoader, client, remoteClients);