for (int i = 0; i < wsToDeploy.size(); i++) {
currentArchiveFile = (ArchiveFileData) wsToDeploy.get(i);
explodedDir = currentArchiveFile.getFile().isDirectory();
int type = currentArchiveFile.getType();
try {
ArchiveReader archiveReader;
StringWriter errorWriter = new StringWriter();
switch (type) {
case SERVICE:
currentArchiveFile.setClassLoader(explodedDir);
archiveReader = new ArchiveReader();
String serviceStatus = "";
try {
archiveReader.processWSDLs(currentArchiveFile,this);
// ServiceDescription service = archiveReader.createService(currentArchiveFile.getAbsolutePath());
ServiceGroupDescription sericeGroup =
new ServiceGroupDescription(axisConfig);
archiveReader.processServiceGroup(currentArchiveFile.getAbsolutePath(),
this,
sericeGroup,explodedDir);
// archiveReader.readServiceArchive(currentArchiveFile.getAbsolutePath(),
// this,
// service);
addnewService(sericeGroup);
log.info(Messages.getMessage(
DeploymentErrorMsgs.DEPLOYING_WS, currentArchiveFile.getName()));
} catch (DeploymentException de) {
log.info(Messages.getMessage(DeploymentErrorMsgs.IN_VALID_SERVICE,
currentArchiveFile.getName()));
// log.info("DeploymentException " + de);
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
de.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} catch (AxisFault axisFault) {
log.info(Messages.getMessage(DeploymentErrorMsgs.IN_VALID_SERVICE,
currentArchiveFile.getName()));
// log.info("AxisFault " + axisFault);
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
axisFault.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} catch (Exception e) {
log.info(Messages.getMessage(DeploymentErrorMsgs.IN_VALID_SERVICE,
currentArchiveFile.getName()));
// log.info("Exception " + e);
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
e.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} finally {
if (serviceStatus.startsWith("Error:")) {
axisConfig.getFaultyServices().put(getAxisServiceName(currentArchiveFile.getName()),
serviceStatus);
}
currentArchiveFile = null;
}
break;
case MODULE:
currentArchiveFile.setClassLoader(explodedDir);
archiveReader = new ArchiveReader();
String moduleStatus = "";
try {
ModuleDescription metaData = new ModuleDescription();
metaData.setParent(axisConfig);
archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(),
this,
metaData,explodedDir);
addNewModule(metaData);
log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
metaData.getName().getLocalPart()));