use of org.neo4j.desktop.model.exceptions.UnableToStartServerException in project neo4j by neo4j.
the class DatabaseActions method start.
public void start() throws UnableToStartServerException {
if (isRunning()) {
throw new UnableToStartServerException("Already started");
}
Config config = model.getConfig();
Monitors monitors = new Monitors();
LogProvider userLogProvider = FormattedLogProvider.toOutputStream(System.out);
GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies().userLogProvider(userLogProvider).monitors(monitors);
server = new CommunityNeoServer(config, dependencies, userLogProvider);
try {
server.start();
} catch (ServerStartupException e) {
server = null;
Set<Class> causes = extractCauseTypes(e);
if (causes.contains(StoreLockException.class)) {
throw new UnableToStartServerException("Unable to lock store. Are you running another Neo4j process against this database?");
}
if (causes.contains(BindException.class)) {
throw new UnableToStartServerException("Unable to bind to port. Are you running another Neo4j process on this computer?");
}
throw new UnableToStartServerException(e.getMessage());
}
}
Aggregations