grails - 在grails中使用spring-data-neo4j获取UnsatisfiedDependencyException

标签 grails neo4j spring-data-neo4j

我想在我的grails应用程序中使用spring-data-neo4j。

我在BuildConfig中添加了compile 'org.springframework.data:spring-data-neo4j:3.1.1.RELEASE'依赖项。

<neo4j:config storeDirectory="data/graph.db" />添加到applicationContext.xml之后
我在应用程序启动时遇到以下异常:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Unsatisfied dependency expressed through bean property 'conversionService': : Error creating bean with name 'neo4jConversionService' defined in class org.springframework.data.neo4j.config.Neo4jConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [protected org.springframework.core.convert.ConversionService org.springframework.data.neo4j.config.Neo4jConfiguration.neo4jConversionService() throws java.lang.Exception] threw exception; nested exception is java.lang.IllegalStateException: BeanFactory has not been injected into @Configuration class; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neo4jConversionService' defined in class org.springframework.data.neo4j.config.Neo4jConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [protected org.springframework.core.convert.ConversionService org.springframework.data.neo4j.config.Neo4jConfiguration.neo4jConversionService() throws java.lang.Exception] threw exception; nested exception is java.lang.IllegalStateException: BeanFactory has not been injected into @Configuration class
我使用grails 2.4.2

问题是什么?

最佳答案

解决方案是将<context:annotation-config/>添加到applicationContext.xml

关于grails - 在grails中使用spring-data-neo4j获取UnsatisfiedDependencyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24887465/

相关文章:

http - Grails 未找到线程绑定(bind)请求

postgresql - Neo4j 代替关系数据库

java - Neo4J 事务性 REST api 字符串转义不起作用

java - Spring-Data-Neo4j:relationshipEntity 仅返回节点的 graphId。

hibernate - Grails - 不要为某些请求路径打开 hibernate session

mysql - 数据库导入后 Grails 中的 java.lang.IllegalArgumentException

java - 自定义查询不适用于 Spring Data Neo4j 存储库中的界面投影

java - 如何在密码查询中在字段级别分页?

jquery - 如何在 grails 2.0 中获取 JSON

node.js - 在 Node.js 中的 Cypher REST API 中向 Neo4j 提供 'query' 参数的正确方法