Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-3402

Using hibernate-validator ver 5.0.1 throws exception with size validation while notnull validation executes successfully.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.1
    • Fix Version/s: jboss-fuse-6.2
    • Component/s: Camel
    • Labels:
      None
    • Environment:

      Red Hat JBoss Fuse 6.1.1, Windows, Linux

    • Steps to Reproduce:
      Hide

      1) User using hibernate-validations in Red Hat JBoss Fuse 6.1.1 without any patch.
      2) In Affects version section 6.1.1 is not available hence mentioned in Environment section.
      3) There are two maven projects are attached. These can be used as test-case.
      4) File fuse-pocs-blueprint-beanvalidator.zip provides the bundles which provide business-logic to handle hibernate-validation event.
      5) Other file camel-blueprint-client-Validator.zip generate a event that is handled by maven project in use-pocs-blueprint-beanvalidator.zip.
      6) After building these projects using `mvn clean install` command, execute below commands.

      features:install camel-bean-validator
      osgi:install -s mvn:com.fasterxml/classmate/0.8.0
      osgi:install -s mvn:org.jboss.logging/jboss-logging/3.1.3.GA
      osgi:install -s mvn:org.glassfish.web/javax.el/2.2.4
      osgi:install -s mvn:javax.validation/validation-api/1.1.0.Final
      osgi:install -s mvn:javax.el/javax.el-api/2.2.4
      osgi:install -s mvn:org.hibernate/hibernate-validator/5.0.1.Final
      osgi:install -s file:/path/to/fuse-pocs-blueprint-beanvalidator/fuse-pocs-blueprint-beanvalidator-engine/target/fuse-pocs-blueprint-beanvalidator-engine-1.0-SNAPSHOT.jar
      osgi:install -s file:/path/to/fuse-pocs-blueprint-beanvalidator/fuse-pocs-blueprint-beanvalidator-event/target/fuse-pocs-blueprint-beanvalidator-event-1.0-SNAPSHOT.jar
      osgi:install -s mvn:com.mycompany/camel-blueprint-client-Validator/1.0.0-SNAPSHOT
      

      7) Using older version of hibernate-validator jar(version 4.3.1.Final) resolves the issue. If project is build with version 4.3.1.Final and same version is deployed in Fuse. Than issue seems to get resolved.

      osgi:install -s mvn:org.hibernate/hibernate-validator/4.3.1.Final
      

      Show
      1) User using hibernate-validations in Red Hat JBoss Fuse 6.1.1 without any patch. 2) In Affects version section 6.1.1 is not available hence mentioned in Environment section. 3) There are two maven projects are attached. These can be used as test-case. 4) File fuse-pocs-blueprint-beanvalidator.zip provides the bundles which provide business-logic to handle hibernate-validation event. 5) Other file camel-blueprint-client-Validator.zip generate a event that is handled by maven project in use-pocs-blueprint-beanvalidator.zip. 6) After building these projects using `mvn clean install` command, execute below commands. features:install camel-bean-validator osgi:install -s mvn:com.fasterxml/classmate/0.8.0 osgi:install -s mvn:org.jboss.logging/jboss-logging/3.1.3.GA osgi:install -s mvn:org.glassfish.web/javax.el/2.2.4 osgi:install -s mvn:javax.validation/validation-api/1.1.0.Final osgi:install -s mvn:javax.el/javax.el-api/2.2.4 osgi:install -s mvn:org.hibernate/hibernate-validator/5.0.1.Final osgi:install -s file:/path/to/fuse-pocs-blueprint-beanvalidator/fuse-pocs-blueprint-beanvalidator-engine/target/fuse-pocs-blueprint-beanvalidator-engine-1.0-SNAPSHOT.jar osgi:install -s file:/path/to/fuse-pocs-blueprint-beanvalidator/fuse-pocs-blueprint-beanvalidator-event/target/fuse-pocs-blueprint-beanvalidator-event-1.0-SNAPSHOT.jar osgi:install -s mvn:com.mycompany/camel-blueprint-client-Validator/1.0.0-SNAPSHOT 7) Using older version of hibernate-validator jar(version 4.3.1.Final) resolves the issue. If project is build with version 4.3.1.Final and same version is deployed in Fuse. Than issue seems to get resolved. osgi:install -s mvn:org.hibernate/hibernate-validator/4.3.1.Final

      Description

      • User using hibernate-validations in Red Hat JBoss Fuse 6.1.1 without any patch.
      • In Affects version section 6.1.1 is not available hence mentioned in Environment section.
      • His validation works successfully with @NotNull validator but with @Size validator user is receiving below error.

        Caused by: java.lang.ExceptionInInitializerError
                at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateExpression(ResourceBundleMessageInterpolator.java:341)
                at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateMessage(ResourceBundleMessageInterpolator.java:279)
                at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolate(ResourceBundleMessageInterpolator.java:182)
                at org.hibernate.validator.internal.engine.ValidationContext.interpolate(ValidationContext.java:362)
                at org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolation(ValidationContext.java:271)
                at org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolations(ValidationContext.java:232)
                at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291)
                at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133)
                at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91)
                at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83)
                at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547)
                at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487)
                at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451)
                at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403)
                at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206)
                at fuse.pocs.blueprint.beanvalidator.DefaultValidatorBean.validateEvent(DefaultValidatorBean.java:25)[259:fuse-pocs.blueprint-beanvalidator-engine:1.0.0.SNAPSHOT]
                at com.mycompany.camel.blueprint.client.Validator.HelloBean.init(HelloBean.java:23)[261:camel-blueprint-client-Validator:1.0.0.SNAPSHOT]
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_55]
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_55]
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_55]
                at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_55]
                at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)
                at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)
                at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)
                ... 28 more
        Caused by: java.lang.ClassCastException: com.sun.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
                at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:189)
                at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:160)
                at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:59)
        

      • Using older version of hibernate-validator jar(version 4.3.1.Final) resolves the issue.
      • Tried with latest patch of Red Hat JBoss Fuse, issue still remains.
      • Even using higher version of hibernate-validator jar(version 5.1.3.Final) is throwing same exception.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cpandey Chandra Shekhar Pandey
                Tester:
                Lukas Lowinger
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: