java - Spring Commons 和 Spring-data-jpa 一起导入时失败

标签 java spring maven spring-boot spring-data-jpa

我目前正在开发 Spring boot 后端,我的任务是更新所有依赖项并确保它在 Java 11 中运行。

我遇到了异常,发现用maven导入Spring data commons解决了缺少的pageableCustomizer()方法。

<dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-commons</artifactId>
      <version>2.1.10.RELEASE</version>
</dependency>

后者是我添加到maven中的依赖。

添加后,java 告诉我以下内容:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.postProcess(JpaRepositoryConfigExtension.java:120)

The following method did not exist:

    org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/lang/String;

The method's class, org.springframework.data.repository.config.RepositoryConfigurationSource, is available from the following locations:

    jar:file:path_to_project/target/name_of_the_jar.jar!/BOOT-INF/lib/spring-data-commons-2.1.10.RELEASE.jar!/org/springframework/data/repository/config/RepositoryConfigurationSource.class

It was loaded from the following location:

    jar:file:/path_to_project/target/name_of_the_jar.jar!/BOOT-INF/lib/spring-data-commons-2.1.10.RELEASE.jar!/


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.config.RepositoryConfigurationSource

我发现数据JPA,

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-jpa</artifactId>
      <version>2.1.7.RELEASE</version>
</dependency>

依赖于旧版本的数据共享

+ org.springframework.boot:spring-boot-starter-data-jpa:2.1.7.RELEASE
  +  org.springframework.data:spring-data-jpa:1.8.2.RELEASE
    + org.springframework.data:spring-data-commons:1.10.2.RELEASE

这似乎导致了问题。

我已经尝试只使用其中一个,并花了一整天的时间寻找解决方案。

我还尝试使用Spring提供的dependencyManagement:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
</dependency>

这拉取了所有依赖项的相同版本。 (当然,我删除了依赖项中的版本标记)

编辑

依赖项:请求的树。

[INFO] Application:jar:0.0.3
[INFO] +- com.h2database:h2:jar:1.4.199:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.1.7.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.1.7.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.1.7.RELEASE:compile
[INFO] |  |  \- com.zaxxer:HikariCP:jar:3.2.0:compile
[INFO] |  +- javax.transaction:javax.transaction-api:jar:1.3:compile
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] |  |  \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.3.10.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  |  +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.23.2-GA:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.9.16:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] |  |  +- com.fasterxml:classmate:jar:1.4.0:compile
[INFO] |  |  +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] |  |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:1.8.2.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:1.10.2.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-beans:jar:5.1.9.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-core:jar:5.1.9.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-jcl:jar:5.1.9.RELEASE:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.1.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:2.1.7.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.1.7.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.1.7.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.1.7.RELEASE:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.2:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.26:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.23:runtime
[INFO] |  +- org.springframework:spring-aop:jar:5.1.9.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-config:jar:5.1.6.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-core:jar:5.1.6.RELEASE:compile
[INFO] |  \- org.springframework.security:spring-security-web:jar:5.1.6.RELEASE:compile
[INFO] |     +- org.springframework:spring-expression:jar:5.1.9.RELEASE:compile
[INFO] |     \- org.springframework:spring-web:jar:5.1.9.RELEASE:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.6:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:jar:2.1.2.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:2.1.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-crypto:jar:5.1.6.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-commons:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.7.RELEASE:compile
[INFO] |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.60:compile
[INFO] |  |        \- org.bouncycastle:bcprov-jdk15on:jar:1.60:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-hystrix:jar:2.1.0.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:2.1.0.RELEASE:compile
[INFO] |  +- com.netflix.eureka:eureka-client:jar:1.9.8:compile
[INFO] |  |  +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] |  |  |  \- stax:stax-api:jar:1.0.1:runtime
[INFO] |  |  +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] |  |  |  +- com.netflix.netflix-commons:netflix-infix:jar:0.3.0:runtime
[INFO] |  |  |  |  +- commons-jxpath:commons-jxpath:jar:1.3:runtime
[INFO] |  |  |  |  \- org.antlr:antlr-runtime:jar:3.4:runtime
[INFO] |  |  |  |     \- org.antlr:stringtemplate:jar:3.2.1:runtime
[INFO] |  |  |  \- org.apache.commons:commons-math:jar:2.2:runtime
[INFO] |  |  +- com.netflix.archaius:archaius-core:jar:0.7.6:compile
[INFO] |  |  +- com.netflix.servo:servo-core:jar:0.12.21:runtime
[INFO] |  |  +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO] |  |  +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO] |  |  +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.9:runtime
[INFO] |  |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.11:runtime
[INFO] |  |  |  \- commons-codec:commons-codec:jar:1.11:runtime
[INFO] |  |  +- com.google.inject:guice:jar:4.1.0:runtime
[INFO] |  |  |  +- javax.inject:javax.inject:jar:1:runtime
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] |  |  +- com.github.vlsi.compactmap:compactmap:jar:1.2.1:runtime
[INFO] |  |  |  \- com.github.andrewoma.dexx:dexx-collections:jar:0.2:runtime
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] |  +- com.netflix.eureka:eureka-core:jar:1.9.8:compile
[INFO] |  |  \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] |  |     +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] |  |     \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-ribbon:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-netflix-archaius:jar:2.1.0.RELEASE:compile
[INFO] |  |  \- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] |  |     \- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon:jar:2.3.0:compile
[INFO] |  |  |  +- com.netflix.ribbon:ribbon-transport:jar:2.3.0:runtime
[INFO] |  |  |  |  +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] |  |  |  |  \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] |  |  |  +- com.netflix.hystrix:hystrix-core:jar:1.5.18:runtime
[INFO] |  |  |  |  \- org.hdrhistogram:HdrHistogram:jar:2.1.9:runtime
[INFO] |  |  |  \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-core:jar:2.3.0:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-httpclient:jar:2.3.0:compile
[INFO] |  |  |  +- commons-collections:commons-collections:jar:3.2.2:runtime
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-commons-util:jar:0.3.0:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.3.0:compile
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] |  |  \- io.reactivex:rxjava:jar:1.3.8:compile
[INFO] |  +- com.netflix.ribbon:ribbon-eureka:jar:2.3.0:compile
[INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.4.10:compile
[INFO] |     +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |     \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter:jar:3.3.3:compile
[INFO] |  +- org.camunda.bpm:camunda-engine-spring:jar:7.11.0:compile
[INFO] |  |  +- org.camunda.bpm:camunda-engine:jar:7.11.0:compile
[INFO] |  |  |  +- org.camunda.bpm.model:camunda-bpmn-model:jar:7.11.0:compile
[INFO] |  |  |  |  \- org.camunda.bpm.model:camunda-xml-model:jar:7.11.0:compile
[INFO] |  |  |  +- org.camunda.bpm.model:camunda-cmmn-model:jar:7.11.0:compile
[INFO] |  |  |  +- org.camunda.bpm.dmn:camunda-engine-dmn:jar:7.11.0:compile
[INFO] |  |  |  |  +- org.camunda.commons:camunda-commons-utils:jar:1.7.1:compile
[INFO] |  |  |  |  +- org.camunda.bpm.model:camunda-dmn-model:jar:7.11.0:compile
[INFO] |  |  |  |  +- org.camunda.bpm.dmn:camunda-engine-feel-api:jar:7.11.0:compile
[INFO] |  |  |  |  \- org.camunda.bpm.dmn:camunda-engine-feel-juel:jar:7.11.0:compile
[INFO] |  |  |  +- org.camunda.commons:camunda-commons-logging:jar:1.7.1:compile
[INFO] |  |  |  +- org.camunda.commons:camunda-commons-typed-values:jar:1.7.1:compile
[INFO] |  |  |  +- org.mybatis:mybatis:jar:3.4.4:compile
[INFO] |  |  |  +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] |  |  |  \- joda-time:joda-time:jar:2.10.3:compile
[INFO] |  |  \- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] |  |     \- commons-pool:commons-pool:jar:1.6:compile
[INFO] |  +- org.springframework:spring-context:jar:5.1.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:5.1.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:5.1.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-orm:jar:5.1.9.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.1.7.RELEASE:compile
[INFO] |  \- com.fasterxml.uuid:java-uuid-generator:jar:3.1.2:compile
[INFO] +- swagger_spring_Selfmade:jar:0.0.2-20181112140901_9_e91acd7:compile
[INFO] |  +- io.springfox:springfox-swagger2:jar:2.8.0:compile
[INFO] |  |  +- io.swagger:swagger-annotations:jar:1.5.14:compile
[INFO] |  |  +- io.swagger:swagger-models:jar:1.5.14:compile
[INFO] |  |  +- io.springfox:springfox-spi:jar:2.8.0:compile
[INFO] |  |  |  \- io.springfox:springfox-core:jar:2.8.0:compile
[INFO] |  |  +- io.springfox:springfox-schema:jar:2.8.0:compile
[INFO] |  |  +- io.springfox:springfox-swagger-common:jar:2.8.0:compile
[INFO] |  |  +- io.springfox:springfox-spring-web:jar:2.8.0:compile
[INFO] |  |  |  \- org.reflections:reflections:jar:0.9.11:compile
[INFO] |  |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  |  \- org.mapstruct:mapstruct:jar:1.2.0.Final:compile
[INFO] |  \- io.springfox:springfox-swagger-ui:jar:2.8.0:compile
[INFO] +- oidc_auth_filter_selfmade:jar:0.1.0-20181112140634_8_2e26773:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:2.1.7.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-json:jar:2.1.7.RELEASE:compile
[INFO] |  |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.9:compile
[INFO] |  |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.9:compile
[INFO] |  |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.9:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.1.7.RELEASE:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.22:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.22:compile
[INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.22:compile
[INFO] |  |  +- org.hibernate.validator:hibernate-validator:jar:6.0.17.Final:compile
[INFO] |  |  |  \- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  \- org.springframework:spring-webmvc:jar:5.1.9.RELEASE:compile
[INFO] |  +- com.google.guava:guava:jar:21.0:compile
[INFO] |  \- com.nimbusds:oauth2-oidc-sdk:jar:5.64.3:compile
[INFO] |     +- javax.mail:javax.mail-api:jar:1.6.2:compile
[INFO] |     +- com.sun.mail:javax.mail:jar:1.6.2:compile
[INFO] |     |  \- javax.activation:activation:jar:1.1:compile
[INFO] |     +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] |     +- net.minidev:json-smart:jar:2.3:compile (version selected from constraint [1.3.1,2.3])
[INFO] |     |  \- net.minidev:accessors-smart:jar:1.2:compile
[INFO] |     |     \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] |     +- com.nimbusds:lang-tag:jar:1.4.4:compile (version selected from constraint [1.4.3,))
[INFO] |     \- com.nimbusds:nimbus-jose-jwt:jar:7.7:compile (version selected from constraint [5.5,))
[INFO] +- org.springframework.boot:spring-boot-starter-quartz:jar:2.1.7.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:5.1.9.RELEASE:compile
[INFO] |  \- org.quartz-scheduler:quartz:jar:2.3.1:compile
[INFO] |     \- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] +- com.google.code.findbugs:annotations:jar:3.0.1u2:provided
[INFO] |  +- net.jcip:jcip-annotations:jar:1.0:provided
[INFO] |  \- com.google.code.findbugs:jsr305:jar:3.0.1:provided
[INFO] +- camunda_persistence_selfmade:jar:0.0.3-20181204140427_54_6d6c73a:compile
[INFO] +- camunda_templates_modeller(Selfmade):jar:0.1.1-20181204132850_11_89ff2f5:compile
[INFO] +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] |  +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] |  +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile
[INFO] |  +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile
[INFO] |  +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile
[INFO] |  \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] +- jaxrs_client(Selfmade):jar:0.1.0-20181112140855_9_da1fd9b:compile
[INFO] +- jaxrs_jersey_client(Selfmade):jar:0.1.0-20181112141745_76_84d9b84:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] +- commons-io:commons-io:jar:2.5:compile
[INFO] +- org.glassfish.jersey.core:jersey-common:jar:2.29:compile
[INFO] |  +- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.5:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.4:compile
[INFO] |  +- org.glassfish.hk2.external:jakarta.inject:jar:2.5.0:compile
[INFO] |  +- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO] |  \- com.sun.activation:jakarta.activation:jar:1.2.1:compile
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.29:compile
[INFO] +- org.glassfish.jersey.inject:jersey-hk2:jar:2.29:compile
[INFO] |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0:compile
[INFO] |     +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0:compile
[INFO] |     +- org.glassfish.hk2:hk2-api:jar:2.5.0:compile
[INFO] |     \- org.glassfish.hk2:hk2-utils:jar:2.5.0:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.29:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.9:compile
[INFO] |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.9:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-multipart:jar:2.29:compile
[INFO] |  \- org.jvnet.mimepull:mimepull:jar:1.9.11:compile
[INFO] \- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.29:compile

我开始了另一种方法:

删除了所有依赖项并仅添加了构建项目所需的依赖项(目前不起作用),这产生了我之前使用 spring data commons 解决的相同错误消息。这次我无法解决这个问题:

java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration.pageableCustomizer
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:181)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203)
    at SpringApplication.main(WorkflowEngineSpringBootApplication.java:94)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:409)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:400)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:375)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:144)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
    ... 25 common frames omitted
Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration.pageableCustomizer
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanTypeForBeanMethod(OnBeanCondition.java:449)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanType(OnBeanCondition.java:438)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.<init>(OnBeanCondition.java:394)
    ... 28 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.data.web.config.PageableHandlerMethodArgumentResolverCustomizer
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:398)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.getReturnType(OnBeanCondition.java:458)
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanTypeForBeanMethod(OnBeanCondition.java:445)
    ... 30 common frames omitted

编辑2

https://pastebin.com/6ikPBSnF

我的 Maven pom。

最佳答案

问题可能是 spring-data-releasetrain on the Fowler-SR2 的依赖关系发布火车版本。

enter image description here

这个版本已经有几年了,请参阅 maven pom 。您需要查看为什么它包含在您的 pom 中。

关于java - Spring Commons 和 Spring-data-jpa 一起导入时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57593494/

相关文章:

java - Maven exec-plugin pom.xml 定义 : activate shell interpretation for characters

java - 在 SWT 中将 JFreeChart ChartComposite 设置为固定大小

java - CheckStyle SuppressionFilter 模块文件路径以实现 Eclipse 和 Maven 兼容性

java - 正则表达式匹配字符串并排除其他所有内容,直到出现新行

java - Hibernate 配置映射

java - Camel 处理器不 Autowiring Spring bean

java - 错误 : JAVA_HOME is set to an invalid directory:/usr/lib/jvm/java-8-openjdk-amd64

java - 更改jar中的文件

maven - 如何从存储库中列出 Artifact 的传递依赖项?

java - 无法在 java 中导入 dynamodbv2 库