1 Reply Latest reply on Jul 9, 2015 3:12 PM by Shawn Kerstetter

    Problems With Bean Validator and Wildfly 9

    Shawn Kerstetter Newbie

      I have an application running on Wildfly 8.2 and I am trying to port it to Wildfly 9.  After working through the initial classpath / module dependencies, I have reached a problem that I am so far unable to resolve.  When deploying my application, I am receiving the following error:

       

      [exec] 11:26:15,076 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."my-app.ear".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."my-app.ear".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "my-app.ear"

          [exec]    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]

          [exec]    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

          [exec]    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

          [exec]    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]

          [exec]    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]

          [exec]    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

          [exec] Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.

          [exec]    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)

          [exec]    at org.hibernate.validator.internal.cdi.ValidationExtension.<init>(ValidationExtension.java:119)

          [exec]    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_67]

          [exec]    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_67]

          [exec]    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_67]

          [exec]    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_67]

          [exec]    at java.lang.Class.newInstance(Class.java:374) [rt.jar:1.7.0_67]

          [exec]    at org.jboss.as.weld.deployment.WeldPortableExtensions.tryRegisterExtension(WeldPortableExtensions.java:53)

          [exec]    at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:121)

          [exec]    at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:81)

          [exec]    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]

          [exec]    ... 5 more

       

      I declare these module dependencies in my ejb-jar.xml file (org.hibernate,org.hibernate.validator,org.hibernate.validator.cdi) but the problem persists.  So, I added them to my ear/lib directory to work around the problem.  It has, but now I have a new issue that seems related:

       

      2015-07-09 13:23:40,780 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.subunit."my-app.ear"."my-base.jar".CdiValidatorFactoryService: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapp.ear"."my-base.jar".CdiValidatorFactoryService: Failed to start service

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

      Caused by: java.lang.NullPointerException

        at org.jboss.as.weld.CdiValidatorFactoryService.start(CdiValidatorFactoryService.java:84)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

        ... 3 more

       

      Any guidance on the proper way to configure bean validation in wildfly 9 would be helpful.  It appears to be different than 8.2.