gpt4 book ai didi

spring-boot - Spring Data Mongodb 2.0.2 CustomConversions NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-04 02:46:34 24 4
gpt4 key购买 nike

我想使用 Spring Data Mongodb。
问题是,当我将 Spring Data Mongodb 版本从 1.10.9.RELEASE 更改为 2.0.2.RELEASE 时,编译时会出现问题:

java.lang.NoClassDefFoundError: org/springframework/data/convert/CustomConversions
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:697)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:640)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
at org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$BeanPostProcessorsRegistrar.registerSyntheticBeanIfMissing(EmbeddedServletContainerAutoConfiguration.java:148) .....

使用 Spring Data Mongodb 1.x.y 时未出现此问题。
目前我已经用 spring boot 1.5.9.RELEASE 引导了这个项目。

最佳答案

Spring Data 2.x 似乎与 Spring Boot 1.x 不兼容。根据这个问题:

NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute

所以你不能在不升级到 Spring boot 2 的情况下使用 Spring Data Mongodb 2.x 或 Spring Data Neo4J 5.x

关于spring-boot - Spring Data Mongodb 2.0.2 CustomConversions NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47952748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com