我正在尝试将spring 2.0.0升级到2.1.8,并将Neo4j OGM更新为neo4j文档这里中提到的适当版本。
我还提到了迁移文档这里。这说明了2.0到3.0之间的配置类似于3.0和3.1之间的配置。我可能错了
下面是我的代码neo4jogm3.1,并在将sessionFactory连接到SpringBootDataneo4j时获得一个异常。
注意:i最初将我的应用程序从Spring 1.5迁移到2.0,然后按照这里的建议跳转到2.1,因此提供的代码neo4jogm3.1在spring版本2.0.0和Neo4j OGM3.0.1中运行良好,但对Spring 2.1.8和Neo4j OGM3.1.1却不起作用。
错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration$Neo4jOgmSessionFactoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.ogm.session.SessionFactory]: Factory method 'sessionFactory' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]我想我在这里肯定遗漏了一些东西,任何与此相关的建议都会有很大的帮助。
非常感谢您在这个问题上的时间和努力。
发布于 2019-10-11 15:31:34
当我试图从2.1.7升级到2.1.8时,我犯了一个类似的错误,所以您可能想试试2.1.7,看看它是否有效。
此外,我发现施加类有一个java.nio.file.Path属性,这是我的问题的原因。
我的等级:
id 'org.springframework.boot' version '2.1.9.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-data-neo4j'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '2.3.5'也许能帮上忙。
https://stackoverflow.com/questions/57944711
复制相似问题