Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Upgrading Spring Data Neo4j and Neo4j: "Gotchas" to Watch for

DZone's Guide to

Upgrading Spring Data Neo4j and Neo4j: "Gotchas" to Watch for

· Java Zone
Free Resource

Never build auth again! The Okta Developer Platform makes it simple to implement authentication, authorization, MFA and more in Java applications. Get started with the free API.

I'm back with a quick post (with more to come soon).

I was in the middle of upgrading my little test project to a newer version of Spring Data Neo4j and Neo4j itself when I came across a few little points that others might find useful (though it should be noted that Neo4j is set to release 2.0 very soon and is currently doing milestone releases).

I upgraded SDN to 2.3.1.RELEASE and Neo4j (all aspects of it, including Cypher) to 1.9.4.
Here are a couple "gotchas" I encountered:

Dependencies

It would seem that CGLIB has been moved out of one of the Neo4j or SDN dependencies; however, I also found that--with the SDN/Neo4j combination I'm using--that a specific version is required, namely 2.2.2.
Adding this bit into my POM fixed things up nicely:
<dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib</artifactId>
    <version>2.2.2</version>
</dependency>

No Bean Named 'graphDatabaseService' is Defined

This one was fun.  As confirmed in  this Neo4j forum thread (which actually uses Neo4j 1.7 and SDN 2.1.0.Build-Snapshot), when configuring Neo4j in an application context, the bean ID for the graph database service (whether it's embedded or from a server) must be "graphDatabaseService", similar to this:
<bean id="graphDatabaseService"
  class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
  <constructor-arg index="0" value="http://someserver:7474/db/data" />
</bean>
If this little nuance is overlooked, you could very well see exceptions when, say, starting up your application server with your SDN-based application.
In my case, Maven compiled my WAR file just fine, but, starting up Tomcat produced a slew of exceptions.
It would seem that this is an ongoing issue, though, perhaps it's a necessary change from the SDN folks.  We'll just have to see!
Hopefully some people find these tidbits useful.
We'll see you on the next post!

Build and launch faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Published at DZone with permission of Duncan Brown, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}