java.lang.NoSuchMethodError:javax.validation.BootstrapConfiguration.getClockProviderClassName

Spring Boot 2随附了hibernate-validator 6org.hibernate.validator:hibernate-validator:6.0.16.Final依赖于validation-api 2javax.validation:validation-api:2.0.1.Final),后者特定于Java EE 8,请参见附录F.依赖版本。但是可能必须使用Java支持较旧的应用程序服务器仅限EE 7,Spring Framework 5仍应支持它,请参阅运行时支持

在这种情况下,请使用较旧的hibernate-validator5.4.3.Final)和validation-api1.1.0.Final)。如果您使用Spring Boot maven parent,则只需定义这些属性。

<properties>
    <javax-validation.version>1.1.0.Final</javax-validation.version>
    <hibernate-validator.version>5.4.3.Final</hibernate-validator.version>
</properties>

问题是从版本6开始,hibernate-validator已更改groupId,因此您必须排除新的组,但添加旧的组,例如

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>${hibernate-validator.version}</version>
</dependency>

原文地址:https://www.cnblogs.com/jiawen010/p/12620040.html

时间: 2024-11-09 03:40:37

java.lang.NoSuchMethodError:javax.validation.BootstrapConfiguration.getClockProviderClassName的相关文章

记一次部署时报java.lang.NoSuchMethodError:javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax / persistence / ValidationMode;的解决办法

楼主在部署war包的时候,本地启动不报错,服务器商报如下问题: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested excepti

Mingyang.net:java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()

使用hibernate-validator校验数据模型时报出如下异常: java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory; at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:5

【原】tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig的解决

现象: tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig 解决: 把tomcat目录下的lib/servlet-api.jar文件拷贝到$JAVA_HOME/jre/lib/ext目录下,再启动tomcat问题解决

异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

Spring3.0 + Hibernate3.5:启动服务器报:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z 在hibernate3.5之前,我们运用hibernate开发J2EE项目通常会引以下几个jar包:hibernate核心包:hibernate3.jar持久化:ejb3-persistence.jar则javax.persistence.OneToMany.cla

异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z/Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreign

Spring3.0 + Hibernate3.5:启动服务器报:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z 在hibernate3.5之前,我们运用hibernate开发J2EE项目通常会引以下几个jar包:hibernate核心包:hibernate3.jar持久化:ejb3-persistence.jar则javax.persistence.OneToMany.cla

Hibernate常见错误:java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibe

hibernate4 与 spring3有点冲突 http://blog.csdn.net/gyflyx/article/details/7632645 整合NoSuchMethodError错误 and 升级Spring3.1RC2 和Hibernate4.0.0CR7遇到的一些问题及解决 2012-02-20 10:33:28|  分类: 编程_SSH |字号 订阅 我使用的是hibernate4和spring3,然后报的错误是 java.lang.NoSuchMethodError: or

Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode

进行 spring mvc jpa整合时.Junit方法测试时. 异常: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested excep

【转】java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

最近在配置最新的ssh(struts2.3.16.3+hibernate4.3.7+spring4.1.2)的时候遇到的这个错误提示,后来在网上找了半天都不能解决,虽然有个说法是model对象用这样@Entity(name = "UserInfo")的方式来实现,但是这样的话对象和表明必须一致,后来找到如下原因:希望对大家有所帮助,特分享如下: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/p

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决

jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 原因:jetty 9 依赖的servlet-api是3.X版本,如果项目中还有其它第3方开源库隐式依赖了2.x版本的servlet-api,就会报这个错.解决办法:gradle项目中,gradle dependencies 分析所有的依赖项,找出依赖低版本ser