JcrConfiguration config = new JcrConfiguration();
engine = config.loadFrom(JndiRepositoryFactory.class.getResourceAsStream(configResourceName)).build();
engine.start();
Problems problems = engine.getProblems();
for (Problem problem : problems) {
switch (problem.getStatus()) {
case ERROR:
log.error(problem.getThrowable(), problem.getMessage(), problem.getParameters());
break;
case WARNING:
log.warn(problem.getThrowable(), problem.getMessage(), problem.getParameters());
break;
case INFO:
log.info(problem.getThrowable(), problem.getMessage(), problem.getParameters());
break;
}
}
if (problems.hasErrors()) {
throw new RepositoryException(JcrI18n.couldNotStartEngine.text());
}
log.info(JcrI18n.engineStarted, (System.currentTimeMillis() - start));
}