10 Steps to run Spring Data Neo4j at OpenShift
It’s very easy to get Neo4j running on RedHat’s OpenShift Cloud Platform. Note that at the time of writing this, there is no Neo4j cartridge available at OpenShift.
If you are familiar with Heroku, think that a cartridge is like a Heroku Add-on. It plugs functionality into the PaaS environment.
So, how we can use Neo4j at OpenShift? First, remember to always read a README file, if there’s one.
When you create a project at OpenShift, a README file can be located at the root directory of your app. Among other things, we have this line:
../data – For persistent data (also in env var OPENSHIFT_DATA_DIR)
Hmmm that’s interesting! Heroku doesn’t have a place for persistent data across Heroku’s dynos. They are ephemeral, as said by James Ward, here.
From now on, you can guess what to do, right?
The answer is inside of Spring applicationContext.xml file:
<neo4j:config storeDirectory="${OPENSHIFT_DATA_DIR}/graph.db"/>
To let things more easy, I built a OpenShift skeleton app so I don’t have to do it again and again..
You can view and fork it here: https://github.com/tomasmuller/openshift-neo4jtemplate
Oh! Almost forgot! You can read all the 10 steps of this post title, in the project README.md file!
;-)
Github
Steven Citron-Pousty 4:04 pm on March 30, 2012 Permalink
Nicely done on your post. When I try to get neo4j spatial running I will reference you guys for the getting started.
Tomás Augusto Müller 10:15 pm on March 30, 2012 Permalink
Thank you Steven!
10 Steps to run Spring Data Neo4j at OpenShift « Another Word For It 9:10 pm on April 1, 2012 Permalink
[...] 10 Steps to run Spring Data Neo4j at OpenShift. [...]
Hata 12:27 am on April 10, 2012 Permalink
When I deploy my project (CDI, JSF, Spring, Neo4j) to openshift, the server alway throw th waning log as:
WARN [org.jboss.modules] (MSC service thread 1-3) Failed to define class org.neo4j.kernel.impl.osgi.OSGiActivator in Module “deployment.ROOT.war:main” from Service Module Loader: java.lang.LinkageError: Failed to link org/neo4j/kernel/impl/osgi/OSGiActivator (Module “deployment.ROOT.war:main” from Service Module Loader)
… …
Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_22]
Please give me any suggestion in this situation
Thanks Steven.
Delicious Bookmarks for April 12th from 21:12 to 21:26 « Lâmôlabs 11:01 pm on April 12, 2013 Permalink
[...] 10 Steps to run Spring Data Neo4j at OpenShift | Code n’roll – April 12th ( tags: neo4j setup openshift howto tips ) [...]