for (int i = 0; i < applications.length; i++) {
J2EEApplication app = applications[i];
System.out.println("Application "+i+": "+app.getObjectName());
J2EEModule[] modules = mgr.getModules(app);
for (int j = 0; j < modules.length; j++) {
J2EEModule deployment = modules[j];
System.out.println(" Module "+j+": "+deployment.getObjectName());
}
}
} catch (IOException e) {
e.printStackTrace();
}