在grails中使用spring-data-neo4j会得到UnsatisfiedDependencyException [英] use spring-data-neo4j in grails get UnsatisfiedDependencyException
问题描述
我已经添加了 compile'org.springframework.data :spring-data-neo4j:3.1.1.RELEASE'
依赖于BuildConfig。
在添加< neo4j :config storeDirectory =data / graph.db/>
到 applicationContext.xml
i在应用程序启动时获得以下异常:
org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为'org.springframework.data.neo4j.config.Neo4jConfiguration#0的bean时出错':通过bean属性'conversionService'表达的不满意的依赖关系::在类org.springframework.data.neo4j.config.Neo4jConfiguration中定义的名为'neo4jConversionService'的bean创建时出错:bean的实例化失败;嵌套异常是org.springframework.beans.factory.BeanDefinitionStoreException:工厂方法[protected org.springframework.core.convert.ConversionService org.springframework.data.neo4j.config.Neo4jConfiguration.neo4jConversionService()throws java.lang.Exception]引发异常;嵌套异常是java.lang.IllegalStateException:BeanFactory没有被注入到@Configuration类中;嵌套异常是org.springframework.beans.factory.BeanCreationException:在类org.springframework.data.neo4j.config.Neo4jConfiguration中定义名称为'neo4jConversionService'的bean时出错:bean实例化失败;嵌套异常是org.springframework.beans.factory.BeanDefinitionStoreException:工厂方法[protected org.springframework.core.convert.ConversionService org.springframework.data.neo4j.config.Neo4jConfiguration.neo4jConversionService()throws java.lang.Exception]引发异常;嵌套异常是java.lang.IllegalStateException:BeanFactory没有被注入到@Configuration类中使用grails 2.4.2
有什么问题?解决方法是将<$ c $添加到<
i want to use spring-data-neo4j in my grails application.
i've added the compile 'org.springframework.data:spring-data-neo4j:3.1.1.RELEASE'
dependency in BuildConfig.
After adding <neo4j:config storeDirectory="data/graph.db" />
to the applicationContext.xml
i get following exception at application start:
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
i use grails 2.4.2
what is the problem?
the solution was to add <context:annotation-config/>
to the applicationContext.xml
这篇关于在grails中使用spring-data-neo4j会得到UnsatisfiedDependencyException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!