java.lang.NoSuchMethodError: java.util.Collections.emptyIterator()Ljava/util/Iterator;

Hibernate JIRA | Vadim Bauer | 2 years ago
  1. 0

    Collections.emptyIterator(); is only available in Java 1.7 not in 1.6 {noformat} java.lang.NoSuchMethodError: java.util.Collections.emptyIterator()Ljava/util/Iterator; at org.hibernate.validator.internal.engine.ValidatorImpl.createIteratorForCascadedValue(ValidatorImpl.java:647) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:614) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat}

    Hibernate JIRA | 2 years ago | Vadim Bauer
    java.lang.NoSuchMethodError: java.util.Collections.emptyIterator()Ljava/util/Iterator;
  2. 0

    Collections.emptyIterator(); is only available in Java 1.7 not in 1.6 {noformat} java.lang.NoSuchMethodError: java.util.Collections.emptyIterator()Ljava/util/Iterator; at org.hibernate.validator.internal.engine.ValidatorImpl.createIteratorForCascadedValue(ValidatorImpl.java:647) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:614) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat}

    Hibernate JIRA | 2 years ago | Vadim Bauer
    java.lang.NoSuchMethodError: java.util.Collections.emptyIterator()Ljava/util/Iterator;
  3. 0

    Cannot insert multiple users to DB in same time

    Stack Overflow | 2 years ago | user3698023
    java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory; at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:59)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    In DTO, validation rule is like this: {code} @NotEmpty private List<String> stringListData; {code} In TestCase, this is true, violation count = 1 {code} List<String> stringListData = null; stringListDto.setStringListData(stringListData); Set<ConstraintViolation<StringListDto>> constraintViolations = validator .validate(stringListDto); logger.error("violation count: {}", constraintViolations.size()); Assert.assertEquals(1, constraintViolations.size()); {code} But, this has error, NoSuchMethodError occures: {code} List<String> stringListData = new ArrayList<String>(); stringListDto.setStringListData(stringListData); Set<ConstraintViolation<StringListDto>> constraintViolations = validator .validate(stringListDto); logger.error("violation count: {}", constraintViolations.size()); Assert.assertEquals(1, constraintViolations.size()); {code} I expect violation count is 1, because stringListData is empty. But NoSuchMethodError occures. {noformat} java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory; at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:59) 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.validateComposingConstraints(ConstraintTree.java:233) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:102) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:84) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:525) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:465) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:429) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:381) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:184) at javax.validation.HibernateValidatorTest.testNotEmpty2(HibernateValidatorTest.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) {noformat}

    Hibernate JIRA | 3 years ago | Shin Sang-Jae
    java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
  6. 0

    Throw java.lang.NoSuchMethodError: java.util.List.java_util_List_iterator()Ljava/util/Iterator during running test

    GitHub | 3 years ago | vparfonov
    java.lang.NoSuchMethodError: java.util.List.java_util_List_iterator()Ljava/util/Iterator;

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      java.util.Collections.emptyIterator()Ljava/util/Iterator;

      at org.hibernate.validator.internal.engine.ValidatorImpl.createIteratorForCascadedValue()
    2. Hibernate Validator Engine
      ValidatorImpl.validate
      1. org.hibernate.validator.internal.engine.ValidatorImpl.createIteratorForCascadedValue(ValidatorImpl.java:647)
      2. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:614)
      3. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
      4. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723)
      5. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601)
      6. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
      7. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723)
      8. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601)
      9. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
      10. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723)
      11. org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601)
      12. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
      13. org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206)
      13 frames