3 Replies Latest reply on Aug 7, 2015 11:18 AM by Sreenath Reddy

    WildFly 8.2 java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator after upgrading my hibernate from 3.3 to 3.6.3

    Sreenath Reddy Novice

      Hi All,

       

      I am migrating my application from Jboss 5.1 to WildFly 8.2, As part of this earlier we are using Hibernate 3.3.0, now we migrated it to 3.6.3. After migrating, while wildfly server is starting I am getting the below Exception.

       

      The below is my server log

       

      15:01:25,284 INFO  [org.jboss.seam.Component] (MSC service thread 1-1) Component: BasicSettingsManager, scope: CONVERSATION, type: JAVA_BEAN, class: com.project.action.codegen.BasicSettingsManager

      15:01:25,293 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./project: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./project: Failed to start service

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

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]

      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Could not create Component: BasicSettingsManager

        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:222)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)

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

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

        ... 3 more

      Caused by: java.lang.RuntimeException: Could not create Component: BasicSettingsManager

        at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1202)

        at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1118)

        at org.jboss.seam.init.Initialization.init(Initialization.java:733)

        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)

        at com.project.session.ProjectSessionListener.contextInitialized(ProjectSessionListener.java:58)

        at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)

        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)

        ... 7 more

      Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator

        at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.8.0_11]

        at java.lang.Class.privateGetDeclaredMethods(Class.java:2688) [rt.jar:1.8.0_11]

        at java.lang.Class.getDeclaredMethods(Class.java:1962) [rt.jar:1.8.0_11]

        at org.jboss.seam.Component.initMembers(Component.java:550)

        at org.jboss.seam.Component.<init>(Component.java:244)

        at org.jboss.seam.Component.<init>(Component.java:205)

        at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186)

        ... 13 more

      Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator from [Module "deployment.project-ear.ear.jboss-seam.jar:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]

        ... 20 more

       

       

      15:01:25,318 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "project-ear.ear")]) - failure description: {

          "JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./project" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./project: Failed to start service

          Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Could not create Component: BasicSettingsManager

          Caused by: java.lang.RuntimeException: Could not create Component: BasicSettingsManager

          Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator

          Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator from [Module \"deployment.project-ear.ear.jboss-seam.jar:main\" from Service Module Loader]"},

          "JBAS014771: Services with missing/unavailable dependencies" => [

              "jboss.deployment.subunit.\"project-ear.ear\".\"project-ejb.jar\".component.BookingSumMessageProcessor.CREATE is missing [jboss.ejb.pool-config.StrictMaxPool, jboss.ra.hornetq-ra]",

              "jboss.deployment.subunit.\"project-ear.ear\".\"project-ejb.jar\".component.AsyncReportQueueProcessor.CREATE is missing [jboss.ejb.pool-config.StrictMaxPool, jboss.ra.hornetq-ra]"

          ]

      }

       

       

      As per my analysis earlier the class org.hibernate.validator.ClassValidator is located at hibernate-validator.jar and after 3.5.x it was moved to hibernate-validator.jar. In my project we are using hibernate-validator-4.2.0. I also observed that the class org.hibernate.validator.ClassValidator is not available at hibernate-validator-4.2.0. If I add hibernate-annotation jar to the ear, it is throwing named query exceptions. Is there any way to resolve this issue.