java.lang.IllegalArgumentException: could not instantiate ClassValidator

Hibernate JIRA | Christian Laakmann | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    When I use the @NotEmpty Validator on a String property, Hibernate Tools is unable to open a new Session because the ClassValidator could not be instantiated. Workaround was to replace @NotEmpty with @NotNull. see also: http://forum.hibernate.org/viewtopic.php?p=2339708#2339708 Stack-Trace: java.lang.IllegalArgumentException: could not instantiate ClassValidator at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:287) at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107) at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66) at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37) at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283) ... 16 more java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107) at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66) at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37) at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283) at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Hibernate JIRA | 1 decade ago | Christian Laakmann
    java.lang.IllegalArgumentException: could not instantiate ClassValidator
  2. 0

    When I use the @NotEmpty Validator on a String property, Hibernate Tools is unable to open a new Session because the ClassValidator could not be instantiated. Workaround was to replace @NotEmpty with @NotNull. see also: http://forum.hibernate.org/viewtopic.php?p=2339708#2339708 Stack-Trace: java.lang.IllegalArgumentException: could not instantiate ClassValidator at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:287) at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107) at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66) at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37) at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283) ... 16 more java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107) at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66) at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37) at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283) at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Hibernate JIRA | 1 decade ago | Christian Laakmann
    java.lang.IllegalArgumentException: could not instantiate ClassValidator

    Root Cause Analysis

    1. java.util.MissingResourceException

      Can't find resource in validator bundles, key validator.notEmpty

      at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace()
    2. org.hibernate.validator
      DefaultMessageInterpolatorAggerator.addInterpolator
      1. org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107)
      2. org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66)
      3. org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37)
      3 frames
    3. Hibernate Validator Engine
      ClassValidator.<init>
      1. org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283)
      2. org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255)
      3. org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
      4. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127)
      5. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
      6. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
      6 frames
    4. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319)
      2. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
      2 frames
    5. org.hibernate.console
      ConsoleConfiguration.buildSessionFactory
      1. org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
      2. org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
      3. org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
      4. org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
      4 frames
    6. org.hibernate.eclipse
      BasicWorkbenchAdapter.fetchDeferredChildren
      1. org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
      2. org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
      3. org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
      3 frames
    7. Workbench
      DeferredTreeContentManager$1.run
      1. org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
      1 frame
    8. Eclipse Jobs
      Worker.run
      1. org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
      1 frame