user3042984 user3042984 - 14 days ago 7
Java Question

embedded neo4j database with tomcat 7.0 eclipse plugin Unable to create directory path for Neo4j store

I'm using an embedded neo4j Database and everything works fine when I run a main in my java code. But if I try to connect to the database with a servlet on my tomcat plugin in eclipse there is this error:

Unable to create directory path [database\data\graph.db] for Neo4j store


My databse is stored in my javaproject. I'm pretty sure it's because the tomcat-plugin needs another path but I'm new to this kind of stuff and hope that someone can tell me whats the right path or show me a tutorial.

greetings

Answer

Check your current working directory, and verify that you have permissions to create files there. You can get your current working directory via the java System.getProperty("user.dir").

When you're running under tomcat inside of eclipse, sometimes the directory will be somewhere different than you expect, because it depends on many aspects of how you configured tomcat and eclipse. So the first order of business is to figure out where exactly you're trying to write to. Then verify that your user has permission to write to that directory, and that the directory/file doesn't already exist/isn't marked read-only.