java.lang.ClassCastException: com.sun.proxy.$Proxy95 cannot be cast to com.my.validator.FieldMatch

Stack Overflow | rv1980 | 5 months 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

    JSR 303 implementation gives ClassCastException

    Stack Overflow | 5 months ago | rv1980
    java.lang.ClassCastException: com.sun.proxy.$Proxy95 cannot be cast to com.my.validator.FieldMatch

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.sun.proxy.$Proxy95 cannot be cast to com.my.validator.FieldMatch

      at com.my.validator.FieldMatchValidator.initialize()
    2. com.my.validator
      FieldMatchValidator.initialize
      1. com.my.validator.FieldMatchValidator.initialize(FieldMatchValidator.java:14)[classes/:na]
      1 frame
    3. Hibernate Validator Engine
      ValidatorImpl.validateMetaConstraint
      1. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.initializeConstraint(ConstraintValidatorManager.java:261)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      2. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.createAndInitializeValidator(ConstraintValidatorManager.java:183)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      3. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.getInitializedValidator(ConstraintValidatorManager.java:122)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      4. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:303)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      5. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:244)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      6. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:163)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      7. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:116)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      8. org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:87)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      9. org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      10. org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:617)[hibernate-validator-5.2.4.Final.jar:5.2.4.Final]
      10 frames