创建类路径资源中定义的名为“defaultValidator”的 bean 时出错

2024-03-28

尝试在 JBOSS 上部署 Spring Boot 应用程序时出现以下错误。但它在嵌入式 Tomcat 服务器上运行良好。我尝试浏览 Stack Overflow 以查找类似的问题。尚未找到解决方案。任何建议,将不胜感激。谢谢。

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
00:36:34,356 ERROR [org.springframework.boot.SpringApplication] (ServerService Thread Pool -- 56) Application run failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.validation.Configuration.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$123/1614986064.getObject(Unknown Source)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) [spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) [spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) [spring-web-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:187) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3775) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_31]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_31]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_31]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_31]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NoSuchMethodError: javax.validation.Configuration.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
    at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.configureParameterNameProvider(LocalValidatorFactoryBean.java:314) [spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:290) [spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) [spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
    ... 30 more

我在 springboot2.0 中通过在 build.gradle 中添加 org.springframework.boot:spring-boot-starter-validation 解决了这个问题https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

创建类路径资源中定义的名为“defaultValidator”的 bean 时出错 的相关文章

随机推荐

  • 在 Django/mod_wsgi 虚拟环境中配置 WSGIPythonHome 的问题

    我在 Windows 10 上运行 Python 3 7 1 和 Apache 2 4 38 我设置了一个虚拟环境 其中包含通过 pip 安装的 Django 2 2 5 和 mod wsgi 4 6 5 在 httpd conf 内部 我
  • 如何获取字符串中所有匹配的位置?

    我有一个专栏flag acumu在 PostgreSQL 的表中 其值如下 SSNSSNNNNNNNNNNNNNNNNNNNNNNNNNNNNSNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 我需要用 S 显
  • “user-images.githubusercontent.com”上的图像可以删除吗?

    我不小心在 GitHub 上上传了一张我不想放的图片 我原以为出于示例目的 我已经从上传的图像中删除了私人信息 但私人信息仍然存在 它包含诸如主机名之类的内容 我希望这些内容不是公开的 有没有办法从 github 的图像注册表中删除该图像
  • 到本地主机的 New-PSSession 失败

    我有一个打开本地主机远程会话的脚本 我需要这个来从登录脚本中在某些设备上安装 NuGet Username Admin Password ConvertTo SecureString adminPW AsPlainText Force ad
  • getElementsByClassName onclick 问题[重复]

    这个问题在这里已经有答案了 我在用着罗伯特 尼曼的 http robertnyman com 2008 05 27 the ultimate getelementsbyclassname anno 2008 脚本来获取文档中具有相同类的所有
  • 使用非 root 且无需 CPAN 安装 Perl 模块和依赖项

    我一直在为我的工作编写 Perl 脚本 而我工作的机器使安装 Perl 模块变得困难 我们不能有gcc出于安全原因 在我的机器上 所以对于大多数模块 我无法使用 CPAN 来安装模块 我无权访问 root 帐户 通常 当我想安装模块时 我会
  • 朱莉娅:当我有情节时如何找到最佳拟合曲线/方程?

    朱莉娅 当我有情节时如何找到最佳拟合曲线 方程 我有一个用地图绘制的图 但我需要找到一个适合这个的二次方程 正如评论中所说 情节在这里并不重要 只有数据本身是 您可以使用诸如GLM构建数据的 广义 线性模型 并可能绘制它们或使用它们来预测新
  • 请求的运行时 (python-) 不适用于此堆栈 (heroku-20)

    我在尝试通过 Heroku 部署这个 Flask 应用程序时遇到了困难 我研究了多种方法来解决这个问题 但似乎找不到一种可行的方法 这就是当我推动时我得到的git push heroku master remote gt Building
  • Dev-C++ 输入已跳过

    include
  • .NET 4.0 解决方案中的 NHibernate 1.2

    我有一些基于 NHibernate 1 2 的项目 我想将它们添加到 NET 4 0 解决方案中 但我收到 AmbigeousMatchException 无论这些项目是针对2 0还是4 0框架 如果我将它们添加到 NET 3 5 解决方案
  • 将刻度转换为时间格式 (hh:mm:ss)

    我从网络服务器获取视频长度值作为刻度 我想以 hh mm ss 格式显示它 我怎样才能在 JavaScript 中做到这一点 假设刻度以秒为单位 如果不是 您可以先将其转换为秒 您可以通过查找时间跨度中的整分钟数和小时数 然后获取剩余的秒数
  • 我什么时候应该使用解析器?

    我在正则表达式中遇到了将代码划分为功能组件的问题 它们可能会破裂 也可能需要很长时间才能完成 这段经历提出了一个问题 我什么时候应该使用解析器 当您对以下内容感兴趣时 应该使用解析器文本的词汇或语义意义 当模式可以变化时 当您只是想了解时
  • Java正则表达式正向预测但仅匹配唯一字符?

    我正在尝试将字符串输入与以下条件进行匹配 第一个字符是unique小写英文字母 接下来的字符代表从 1500 到 2020 的当前年份 接下来的字符只能是 10 或 100 或 1000 最后一个字符是 0 到 9 之间的数字 我创建的正则
  • 在多个数据库上使用 ActiveRecord

    我正在编写一个工资系统 它将与现有系统集成 原始系统有一个主数据库 用于处理用户管理和一些全局配置 下面有多个结构相同的数据库 基本上每个数据库都是一个公司的工资数据库 所有这些都与主数据库绑定 因为它属于父数据库公司拥有多家子公司 每个子
  • 在 matplotlib 底图投影上绘制椭圆

    我正在尝试在底图投影上绘制椭圆 要画一个像多边形一样的圆 有tissot用于绘图的函数天梭的指标 http en wikipedia org wiki Tissot 27s indicatrix如下例所示 from mpl toolkits
  • BeautifulSoup XML 仅打印第一行

    我正在使用 BeautifulSoup4 和 lxml 来解析 XML 文件 由于某种原因 当我打印 soup prettify 时 它只打印第一行 from bs4 import BeautifulSoup f open xmlDoc x
  • 将复选框数据插入mysql

    我的问题如下 这是我的 mySQL 表和 HTML 表单 https i stack imgur com g4qp5 jpg 我需要找到一个 PHP 代码来将复选框数据插入到 mySQL 表中 如果选中一个复选框 我想将该特定列填充为 1
  • 如何编写包含引号的字符串文字?

    我想用这个确切的文本创建一个字符串 nuke execute Write1 1 10 1 只需用双引号将其引起来 例如 nuke execute Write1 1 10 1 不起作用 gt gt gt nuke execute Write1
  • 使用自定义 INF 的微控制器的 USB 驱动程序安装问题

    我正在使用 NXP LPC1788 微控制器 并尝试在主机上创建一个驱动程序以通过 USB 与其进行通信 我相信我已经设法让设备正确处理标准 USB 请求 PC 能够正确读取字符串描述符 不过 我在编写示例 USB 驱动程序并为设备安装它时
  • 创建类路径资源中定义的名为“defaultValidator”的 bean 时出错

    尝试在 JBOSS 上部署 Spring Boot 应用程序时出现以下错误 但它在嵌入式 Tomcat 服务器上运行良好 我尝试浏览 Stack Overflow 以查找类似的问题 尚未找到解决方案 任何建议 将不胜感激 谢谢 Error