0

Does anyone know how to get SpatialRepository @Autowiring in a spring boot app? I have put the additional dependency in my classpath

<dependency>
  <groupId>org.neo4j</groupId>
  <artifactId>neo4j-spatial</artifactId>
  <version>0.9</version>
</dependency>

with the following configuration options

@SuppressWarnings("unused")
@Configuration
@EnableAutoConfiguration 
@EnableTransactionManagement
@EnableNeo4jRepositories(basePackages = {"com.eanda.prototype", "test.com.eanda.prototype"})
@ComponentScan({"com.erranda.prototype", "org.springframework.data.neo4j"})

I have tried it all but no avail. My domain class is this:

    public interface ErrandRepository extends GraphRepository<Errand>, SpatialRepository<Errand> {}

I get the following exception when running a query on the spatial repo

    java.lang.IllegalArgumentException: No index provider 'spatial' found. Maybe the intended provider (or one more of its dependencies) aren't on the classpath or it failed to load.
F.O.O
  • 4,730
  • 4
  • 24
  • 34
  • Could you post your `SpatialRepository`e.g. `public interface PersonRepository extends SpatialRepository {}`. Do you have `spring-data-neo4j` in your pom? There is a quite easy to follow tutorial here: https://spring.io/guides/gs/accessing-data-neo4j/ this works for me. – Andreas Jan 17 '15 at 21:11
  • @Andreas my project had used the GraphRepository which worked fine. But the Spatial repo creates the exception now in the question. Here's a related question, http://stackoverflow.com/questions/19198275/no-index-provider-spatial-found but the solution doesnt solve my problem. – F.O.O Jan 17 '15 at 21:27
  • Your exception really looks like the jar for spartial indexes is not on the classpath. Did you add the plugin to your neo4j server https://github.com/neo4j-contrib/spatial#using-the-neo4j-spatial-server-plugin – Andreas Jan 17 '15 at 23:57
  • I am using an embedded database. – F.O.O Jan 18 '15 at 00:00

1 Answers1

0

Are you introducing the spatial engine to an existing database? Have you installed the spatial extension in the plugin directory? Lorenzo

inserpio
  • 206
  • 1
  • 3