If you’re using Spring for wiring components, or Spring Data Neo4j, then it’s up to the container to build up the GraphDatabaseService class for you. Doing this with factories is a little bit more tricky, but I’ve created two Gists to demonstrate how it's done.