use spring-data-neo4j in grails get UnsatisfiedDependencyException

拟墨画扇 提交于 2019-12-11 12:07:12

问题


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?


回答1:


the solution was to add <context:annotation-config/> to the applicationContext.xml



来源:https://stackoverflow.com/questions/24887465/use-spring-data-neo4j-in-grails-get-unsatisfieddependencyexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!