use of org.glassfish.hk2.api.MultiException in project Payara by payara.
the class ApplicationLifecycle method startContainers.
protected boolean startContainers(Collection<EngineInfo> containersInfo, Logger logger, DeploymentContext context) {
ActionReport report = context.getActionReport();
for (EngineInfo engineInfo : containersInfo) {
Container container;
try {
container = engineInfo.getContainer();
} catch (Exception e) {
logger.log(SEVERE, KernelLoggerInfo.cantStartContainer, new Object[] { engineInfo.getSniffer().getModuleType(), e });
return false;
}
Class<? extends Deployer> deployerClass = container.getDeployer();
Deployer deployer;
try {
deployer = habitat.getService(deployerClass);
engineInfo.setDeployer(deployer);
} catch (MultiException e) {
report.failure(logger, "Cannot instantiate or inject " + deployerClass, e);
engineInfo.stop(logger);
return false;
} catch (ClassCastException e) {
engineInfo.stop(logger);
report.failure(logger, deployerClass + " does not implement " + " the org.jvnet.glassfish.api.deployment.Deployer interface", e);
return false;
}
}
return true;
}
use of org.glassfish.hk2.api.MultiException in project Payara by payara.
the class CommandRunnerTest method validateParametersTest.
@Test
public void validateParametersTest() {
ParameterMap params = new ParameterMap();
params.set("foo", "bar");
params.set("hello", "world");
params.set("one", "two");
try {
cr.validateParameters(new CommandModelImpl(DummyAdminCommand.class), params);
} catch (MultiException ce) {
String expectedMessage = " Invalid option: one";
assertTrue(ce.getMessage().contains(expectedMessage));
}
}
Aggregations