Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13461

Jaxrs requires bean-validation when cdi is present

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 20.0.0.Beta1, 20.0.0.Final
    • 20.0.0.Beta1
    • REST
    • None

      We are provisioning a server containing jaxrs and cdi. The deployment fails with the pasted exception.
      This has been caused by fix for WFLY-13189. bean-validation subsystem used to be provisioned with cdi.

      12:57:20,521 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool – 16) RESTEASY002225: Deploying javax.ws.rs.core.Application: class com.example.demo.rest.RestApplication
      12:57:20,562 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 16) MSC000001: Failed to start service jboss.deployment.unit."ROOT.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".undertow-deployment: javax.validation.ValidationException: RESTEASY008520: Unable to load Validation support
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      Caused by: javax.validation.ValidationException: RESTEASY008520: Unable to load Validation support
      at org.jboss.resteasy.plugins.validation.AbstractValidatorContextResolver.getContext(AbstractValidatorContextResolver.java:97)
      at org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(ValidatorContextResolver.java:16)
      at org.jboss.resteasy.core.ResourceMethodInvoker.<init>(ResourceMethodInvoker.java:131)
      at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:351)
      at org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegistry.java:278)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:229)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:201)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:187)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:164)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:81)
      at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:485)
      at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:286)
      at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:92)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:119)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
      at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
      at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:305)
      at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145)
      at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:585)
      at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556)
      at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
      at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
      at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97)
      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
      ... 8 more
      Caused by: javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
      at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:291)
      at org.jboss.resteasy.plugins.validation.AbstractValidatorContextResolver.getConfig(AbstractValidatorContextResolver.java:78)
      at org.jboss.resteasy.plugins.validation.AbstractValidatorContextResolver.getContext(AbstractValidatorContextResolver.java:90)
      ... 34 more

      12:57:20,567 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "jaxrs.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ROOT.war\".undertow-deployment" => "javax.validation.ValidationException: RESTEASY008520: Unable to load Validation support
      Caused by: javax.validation.ValidationException: RESTEASY008520: Unable to load Validation support
      Caused by: javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath."}}

              jdenise@redhat.com Jean Francois Denise
              jdenise@redhat.com Jean Francois Denise
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: