use of org.mule.runtime.deployment.model.api.DeploymentStartException in project mule by mulesoft.
the class DefaultMuleApplication method start.
@Override
public void start() {
withContextClassLoader(null, () -> {
if (logger.isInfoEnabled()) {
logger.info(miniSplash(format("Starting app '%s'", descriptor.getName())));
}
});
try {
this.artifactContext.getMuleContext().start();
// null CCL ensures we log at 'system' level
// TODO getDomainClassLoader a more usable wrapper for any logger to be logged at sys level
withContextClassLoader(null, () -> {
if (logger.isInfoEnabled()) {
ApplicationStartedSplashScreen splashScreen = new ApplicationStartedSplashScreen();
splashScreen.createMessage(descriptor);
logger.info(splashScreen.toString());
}
});
} catch (Exception e) {
setStatusToFailed();
// log it here so it ends up in app log, sys log will only log a message without stacktrace
if (e instanceof MuleException) {
logger.error(((MuleException) e).getDetailedMessage());
} else {
logger.error(null, getRootCause(e));
}
throw new DeploymentStartException(createStaticMessage(format("Error starting application '%s'", descriptor.getName())), e);
}
}
use of org.mule.runtime.deployment.model.api.DeploymentStartException in project mule by mulesoft.
the class DefaultMuleDomain method start.
@Override
public void start() {
try {
if (this.artifactContext != null) {
try {
this.artifactContext.getMuleContext().start();
} catch (MuleException e) {
logger.error(null, getRootCause(e));
throw new DeploymentStartException(createStaticMessage(getRootCauseMessage(e)), e);
}
}
// null CCL ensures we log at 'system' level
// TODO create a more usable wrapper for any logger to be logged at sys level
withContextClassLoader(null, () -> {
DomainStartedSplashScreen splashScreen = new DomainStartedSplashScreen();
splashScreen.createMessage(descriptor);
logger.info(splashScreen.toString());
});
} catch (Exception e) {
throw new DeploymentStartException(createStaticMessage("Failure trying to start domain " + getArtifactName()), e);
}
}
Aggregations