Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Spring Data Neo4j examples [closed]

I'm new to Neo4j and Java and am trying to get the Spring Data Neo4J examples (http://projects.spring.io/spring-data-neo4j/) to work.

Apparently the reason why most of the examples don't work anymore is because there were some major changes with the latest version of Spring Data Neo4j (SDN 3.0).

There was another post (Errors of the Cineasts examples of Spring data neo4j) that mentioned adding the "base-package" attribute in both the neo4j:config and neo4j:repositories elements. I tried doing that and got an additional error: "The prefix "neo4j" for element "neo4j:config" is not bound."

like image 216
completely confused Avatar asked Jul 05 '26 12:07

completely confused


1 Answers

After days of research and much trial and error, I was able to get the cineasts sample project to work. Hopefully this will save you a lot of time.

For the two "Error: cvc-complex-type.4:Attribute 'bases-package' must appear on element 'neo4j:config'" errors, add the base-package attributes (base-package="org.neo4j.cineasts.domain") to the neo4j:config tags in applicationContext.xml (in the src/main/webapp/WEB-INF folder) and movies-test-context.xml (in the test/resources folder).

The other error from tx.close() being undefined can be fixed by changing it to tx.finish().

To run the project, run the Maven build with jetty:run as the goal. Make sure you are using a jdk and not just a jre. I ran it with a jre and got an error and had to run the Maven build with jetty:stop to kill the server before I could re-deploy.

like image 59
user3757494 Avatar answered Jul 07 '26 02:07

user3757494



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!