Log a warning if a check for ModeShape starup problems results in a NPE.  Since it is likely a ModeShape bug that can happen even when the repo starts successfully, proceeds as if everything is fine.
@@ -140,11 +140,18 @@ public class ModeShapeEngineConfig {
public Repository metadataJcrRepository() throws Exception {
JcrRepository repo = modeShapeEngine().deploy(metadataRepoConfig());
+ try {
Problems problems = repo.getStartupProblems();
if (problems.hasErrors()) {
log.error("Problems starting the metadata ModeShape repository: {} \n{}", repo.getName(), problems);
throw new RuntimeException("Problems starting the ModeShape metadata repository: " + problems);
}
+ } catch (NullPointerException e) {
+ // This gets thrown sometimes when attempting to retrieve the startup problems. It looks
+ // like it is probably a ModeShape bug that can happen even when the repo starts successfully.
+ // Just log a warning about it and proceed as if everything is fine.
+ log.warn("Retrieved a NullPointerException when attempting to check for startup errors - this is likely a ModeShape bug and can usually be ignored");
+ }
return repo;
}
