title: Failed to mark transaction as rollback only in Spring Data Neo4j
body: <p>I am trying to setup a simple Spring Data Neo4j (3.2.1) application using Spring Boot (1.2.1) and Java 8. The sources are accessible <a href="https://github.com/vy/spring-data-neo4j-demo" rel="nofollow">here</a>. Given that I followed every single instruction according to the Spring References, my <code>CommandLineRunner</code> fails as follows.</p>
  
  <pre><code>23:36:11.762 [main] ERROR o.s.boot.SpringApplication - Application startup failed
  java.lang.IllegalStateException: Failed to execute CommandLineRunner
      at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:680) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:695) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:961) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:950) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      at com.vlkan.springdataneo4jdemo.Application.main(Application.java:39) [classes/:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
      at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:na]
  Caused by: org.neo4j.graphdb.TransactionFailureException: Failed to mark transaction as rollback only.
      at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:97) ~[neo4j-kernel-2.1.5.jar:2.1.5]
      at org.neo4j.kernel.TopLevelTransaction.failure(TopLevelTransaction.java:86) ~[neo4j-kernel-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.spi.v2_1.TransactionBoundQueryContext.close(TransactionBoundQueryContext.scala:65) ~[neo4j-cypher-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:38) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_1$spi$ExceptionTranslatingQueryContext$$super$close(ExceptionTranslatingQueryContext.scala:34) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:34) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_1$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:152) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.close(ExceptionTranslatingQueryContext.scala:34) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:38) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionWorkflowBuilder$$anonfun$runWithQueryState$1.apply(ExecutionPlanBuilder.scala:164) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionWorkflowBuilder$$anonfun$runWithQueryState$1.apply(ExecutionPlanBuilder.scala:164) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser$$anonfun$1.apply(TaskCloser.scala:43) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser$$anonfun$1.apply(TaskCloser.scala:41) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) ~[scala-library-2.10.4.jar:na]
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) ~[scala-library-2.10.4.jar:na]
      at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library-2.10.4.jar:na]
      at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) ~[scala-library-2.10.4.jar:na]
      at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) ~[scala-library-2.10.4.jar:na]
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser.close(TaskCloser.scala:40) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply$mcV$sp(ClosingIterator.scala:67) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:67) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:67) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$translateException$1.apply(ClosingIterator.scala:72) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.decoratedCypherException(ClosingIterator.scala:102) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.translateException(ClosingIterator.scala:70) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.close(ClosingIterator.scala:66) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$failIfThrows$1.apply(ClosingIterator.scala:96) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.decoratedCypherException(ClosingIterator.scala:102) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.failIfThrows(ClosingIterator.scala:91) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.next(ClosingIterator.scala:44) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult.next(PipeExecutionResult.scala:169) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult.next(PipeExecutionResult.scala:35) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:328) ~[scala-library-2.10.4.jar:na]
      at scala.collection.convert.Wrappers$IteratorWrapper.next(Wrappers.scala:30) ~[scala-library-2.10.4.jar:na]
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult$$anon$1.next(PipeExecutionResult.scala:77) ~[neo4j-cypher-compiler-2.1-2.1.5.jar:2.1.5]
      at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47) ~[neo4j-kernel-2.1.5.jar:2.1.5]
      at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47) ~[neo4j-kernel-2.1.5.jar:2.1.5]
      at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[na:1.8.0_25]
      at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:1.8.0_25]
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) ~[na:1.8.0_25]
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[na:1.8.0_25]
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_25]
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_25]
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[na:1.8.0_25]
      at com.vlkan.springdataneo4jdemo.Application.run(Application.java:30) [classes/:na]
      at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:677) [spring-boot-1.2.1.RELEASE.jar:1.2.1.RELEASE]
      ... 10 common frames omitted
  Caused by: java.lang.NullPointerException: null
      at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:93) ~[neo4j-kernel-2.1.5.jar:2.1.5]
      ... 57 common frames omitted
  23:36:11.763 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@15b3e5b: startup date [Tue Jan 13 23:36:06 CET 2015]; root of context hierarchy
  23:36:11.764 [main] INFO  o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown
  Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner
      at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:680)
      at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:695)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
      at com.vlkan.springdataneo4jdemo.Application.main(Application.java:39)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
  Caused by: org.neo4j.graphdb.TransactionFailureException: Failed to mark transaction as rollback only.
      at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:97)
      at org.neo4j.kernel.TopLevelTransaction.failure(TopLevelTransaction.java:86)
      at org.neo4j.cypher.internal.spi.v2_1.TransactionBoundQueryContext.close(TransactionBoundQueryContext.scala:65)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:38)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_1$spi$ExceptionTranslatingQueryContext$$super$close(ExceptionTranslatingQueryContext.scala:34)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:34)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$$anonfun$close$1.apply(ExceptionTranslatingQueryContext.scala:34)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_1$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:152)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.close(ExceptionTranslatingQueryContext.scala:34)
      at org.neo4j.cypher.internal.compiler.v2_1.spi.DelegatingQueryContext.close(DelegatingQueryContext.scala:38)
      at org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionWorkflowBuilder$$anonfun$runWithQueryState$1.apply(ExecutionPlanBuilder.scala:164)
      at org.neo4j.cypher.internal.compiler.v2_1.executionplan.ExecutionWorkflowBuilder$$anonfun$runWithQueryState$1.apply(ExecutionPlanBuilder.scala:164)
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser$$anonfun$1.apply(TaskCloser.scala:43)
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser$$anonfun$1.apply(TaskCloser.scala:41)
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      at scala.collection.immutable.List.foreach(List.scala:318)
      at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
      at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
      at org.neo4j.cypher.internal.compiler.v2_1.TaskCloser.close(TaskCloser.scala:40)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply$mcV$sp(ClosingIterator.scala:67)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:67)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:67)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$translateException$1.apply(ClosingIterator.scala:72)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.decoratedCypherException(ClosingIterator.scala:102)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.translateException(ClosingIterator.scala:70)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.close(ClosingIterator.scala:66)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator$$anonfun$failIfThrows$1.apply(ClosingIterator.scala:96)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.decoratedCypherException(ClosingIterator.scala:102)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.failIfThrows(ClosingIterator.scala:91)
      at org.neo4j.cypher.internal.compiler.v2_1.ClosingIterator.next(ClosingIterator.scala:44)
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult.next(PipeExecutionResult.scala:169)
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult.next(PipeExecutionResult.scala:35)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
      at scala.collection.convert.Wrappers$IteratorWrapper.next(Wrappers.scala:30)
      at org.neo4j.cypher.internal.compiler.v2_1.PipeExecutionResult$$anon$1.next(PipeExecutionResult.scala:77)
      at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
      at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
      at java.util.Iterator.forEachRemaining(Iterator.java:116)
      at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at com.vlkan.springdataneo4jdemo.Application.run(Application.java:30)
      at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:677)
      ... 10 more
  Caused by: java.lang.NullPointerException
      at org.neo4j.kernel.TopLevelTransaction.markAsRollbackOnly(TopLevelTransaction.java:93)
      ... 57 more
  </code></pre>
  
  <p><code>TransactionFailureException: Failed to mark transaction as rollback only.</code> related problems have been asked before and I believe I read almost all of them, but none solved my issue. So any helps will be really appreciated.</p>