public Throwable getFailureCause() { return actionReport.getFailureCause(); } };
public Throwable getFailureCause() { return actionReport.getFailureCause(); } };
/** * Takes an action report and updates the message in the report with * the message from the root cause of the report. * * @param report */ static void sanitizeReport(ActionReport report) { if (report != null && report.hasFailures() && report.getFailureCause() != null) { Throwable rootCause = ExceptionUtil.getRootCause( report.getFailureCause()); if (rootCause != null && StringUtils.ok(rootCause.getMessage())) { report.setMessage(rootCause.getMessage()); } } }
/** * Takes an action report and updates the message in the report with * the message from the root cause of the report. * * @param report */ static void sanitizeReport(ActionReport report) { if (report != null && report.hasFailures() && report.getFailureCause() != null) { Throwable rootCause = ExceptionUtil.getRootCause( report.getFailureCause()); if (rootCause != null && StringUtils.ok(rootCause.getMessage())) { report.setMessage(rootCause.getMessage()); } } }
"deploy", "failed to deploy {0} for following reason: {1} ", new Object[]{b, reporter.getMessage()}); throw new RuntimeException("Failed to deploy bundle [ " + b + " ], root cause: " + reporter.getMessage(), reporter.getFailureCause());
"deploy", "failed to deploy {0} for following reason: {1} ", new Object[]{b, reporter.getMessage()}); throw new RuntimeException("Failed to deploy bundle [ " + b + " ], root cause: " + reporter.getMessage(), reporter.getFailureCause());
report.getFailureCause()); } else { _logger.log(Level.INFO, "ejb.timer_service_started", new Object[] { resourceName } );
report.getFailureCause()); } else { deployed = true;
private void deployMEJB() throws IOException { _logger.info("Loading MEJB app on JNDI look up"); ServerContext serverContext = habitat.getService(ServerContext.class); File mejbArchive = new File(serverContext.getInstallRoot(), "lib/install/applications/mejb.jar"); DeployCommandParameters deployParams = new DeployCommandParameters(mejbArchive); String targetName = habitat.<Server>getService(Server.class, ServerEnvironment.DEFAULT_INSTANCE_NAME).getName(); deployParams.target = targetName; deployParams.name = "mejb"; ActionReport report = habitat.getService(ActionReport.class, "plain"); Deployment deployment = habitat.getService(Deployment.class); ExtendedDeploymentContext dc = deployment.getBuilder(_logger, deployParams, report).source(mejbArchive).build(); deployment.deploy(dc); if (report.getActionExitCode() != ActionReport.ExitCode.SUCCESS) { throw new RuntimeException("Failed to deploy MEJB app: " + report.getFailureCause()); } } }
logger.log(Level.SEVERE, "Redeployment of application " + app.getName() + " failed: " + report.getMessage() + "\nPlease redeploy " + app.getName() + " manually.", report.getFailureCause()); return false;
public OSGiApplicationInfo deploy(Bundle b) throws DeploymentException { raiseEvent(State.DEPLOYING, b, null); ActionReport report = getReport(); OSGiDeploymentRequest request = createOSGiDeploymentRequest(deployer, archiveFactory, env, report, b); OSGiApplicationInfo osgiAppInfo = request.execute(); if (osgiAppInfo == null) { final Throwable throwable = report.getFailureCause(); raiseEvent(State.FAILED, b, throwable); throw new DeploymentException("Deployment of " + b + " failed because of following reason: " + report.getMessage(), throwable); } raiseEvent(State.DEPLOYED, b, null); return osgiAppInfo; }
public OSGiApplicationInfo deploy(Bundle b) throws DeploymentException { raiseEvent(State.DEPLOYING, b, null); ActionReport report = getReport(); OSGiDeploymentRequest request = createOSGiDeploymentRequest(deployer, archiveFactory, env, report, b); OSGiApplicationInfo osgiAppInfo = request.execute(); if (osgiAppInfo == null) { final Throwable throwable = report.getFailureCause(); raiseEvent(State.FAILED, b, throwable); throw new DeploymentException("Deployment of " + b + " failed because of following reason: " + report.getMessage(), throwable); } raiseEvent(State.DEPLOYED, b, null); return osgiAppInfo; }
public void undeploy(OSGiApplicationInfo osgiAppInfo) throws DeploymentException { final Bundle b = osgiAppInfo.getBundle(); raiseEvent(State.UNDEPLOYING, b, null); ActionReport report = getReport(); OSGiUndeploymentRequest request = createOSGiUndeploymentRequest(deployer, env, report, osgiAppInfo); request.execute(); raiseEvent(State.UNDEPLOYED, b, null); // raise event even if something went wrong if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE) { throw new DeploymentException("Undeployment of " + b + " failed because of following reason: " + report.getMessage(), report.getFailureCause()); } }
public void undeploy(OSGiApplicationInfo osgiAppInfo) throws DeploymentException { final Bundle b = osgiAppInfo.getBundle(); raiseEvent(State.UNDEPLOYING, b, null); ActionReport report = getReport(); OSGiUndeploymentRequest request = createOSGiUndeploymentRequest(deployer, env, report, osgiAppInfo); request.execute(); raiseEvent(State.UNDEPLOYED, b, null); // raise event even if something went wrong if (report.getActionExitCode() == ActionReport.ExitCode.FAILURE) { throw new DeploymentException("Undeployment of " + b + " failed because of following reason: " + report.getMessage(), report.getFailureCause()); } }
} else if (report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) { String errorMessage = report.getMessage(); Throwable cause = report.getFailureCause(); if (cause != null) { String causeMessage = cause.getMessage();
logger.log(Level.INFO, "create.cluster.exec.output", args); if (actionReport.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) { if (actionReport.getFailureCause() != null) { report.setFailureCause(actionReport.getFailureCause()); logger.log(Level.WARNING, localStrings.getString("unable.create.cluster", virtualClusterName), report.getFailureCause()); return null;
} else if (report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) { String errorMessage = report.getMessage(); Throwable cause = report.getFailureCause(); if (cause != null) { String causeMessage = cause.getMessage();
} else if (report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) { String errorMessage = report.getMessage(); Throwable cause = report.getFailureCause(); if (cause != null) { String causeMessage = cause.getMessage();
throw new javax.enterprise.inject.spi.DeploymentException(report.getFailureCause());