gpt4 book ai didi

java - NoSuchMethodError : javax. 验证.BootstrapConfiguration.getClockProvider

转载 作者:行者123 更新时间:2023-12-01 22:52:44 25 4
gpt4 key购买 nike

我正在尝试将 Spring-boot 微服务应用程序从 Jdeveloper 12c 部署到 Weblogic。而且,我遇到了 Maven 的部署问题。我已经将“javax.validation”库包含到 pom.xml 中。但是,它仍然提示 NoSuchMethodError:

javax.validation.BootstrapConfiguration.getClockProviderClassName

POM.XML:

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<!--scope>test</scope-->
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<scope>test</scope>
<version>2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.0.5.RELEASE</version>
<!--scope>test</scope-->
</dependency>
<dependency>
<groupId>oracle.jdbc</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>8.0</version>
<scope>system</scope>
<systemPath>c:\My library\ojdbc8.jar</systemPath>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
</dependencies>

最佳答案

这取决于你的springboot版本

试试这个

    <dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>

而不是

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>

关于java - NoSuchMethodError : javax. 验证.BootstrapConfiguration.getClockProvider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58452555/

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