title: NoSuchMethodError during validator test (javax.el 3.0.0)
body: <p>I try to test validator (hibernate-validator 5.1.3.Final) in spring context. If object is valid test is OK. But if object has invalid fields the error is </p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError:
    javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory.</p>
  </blockquote>
  
  <p>Validator works correctly on the tomcat 8.0 server.</p>
  
  <p>I added the following dependencies, and also tried 2.2.* versions.</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax.el&lt;/groupId&gt;
      &lt;artifactId&gt;javax.el-api&lt;/artifactId&gt;
      &lt;version&gt;3.0.0&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish&lt;/groupId&gt;
      &lt;artifactId&gt;javax.el&lt;/artifactId&gt;
      &lt;version&gt;3.0.0&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Configuration of validator: </p>
  
  <pre><code>&lt;beans:bean
          class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
          id="messageSource" p:basenames="WEB-INF/i18n/messages, WEB-INF/i18n/application"
          p:fallbackToSystemLocale="false" /&gt;
  
  &lt;beans:bean id="validator"
          class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"&gt;
          &lt;beans:property name="validationMessageSource" ref="messageSource"/&gt;    
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>Test</p>
  
  <pre><code>@DirtiesContext
  @ContextConfiguration(classes = {ValidatorTestConfig.class})
  public class ValidatorTest extends AbstractJUnit4SpringContextTests {
  
      @Autowired
      private Validator validator;
  
      private UserTO user;
  
      @Before
      public void initializeUser() {
          user = new UserTO();
          user.setNick("abcd");
          user.setEmail("abcd@abcd.com");
          PasswordTO password = new PasswordTO();
          password.setPassword1("12345678");
          password.setPassword2("12345678");
          user.setPassword(password);
      }
  
      @Test
      public void testValidUser() {
  
          Set&lt;ConstraintViolation&lt;UserTO&gt;&gt; constraintViolations = validator.validate(user);
  
          Assert.assertEquals(0, constraintViolations.size());
      }
  
      @Test
      public void testIllegalNickLength() {
  
          user.setNick("a");
          Set&lt;ConstraintViolation&lt;UserTO&gt;&gt; constraintViolations = validator.validate(user);
  
           Assert.assertEquals(1, constraintViolations.size());
  
           ConstraintViolation&lt;UserTO&gt; violation =  constraintViolations.iterator().next();
           assertThat(violation.getPropertyPath().toString(), equalTo("nick"));
  
      }
  </code></pre>
  
  <p>Trace:</p>
  
  <pre><code>java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
      at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.&lt;clinit&gt;(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:194)
      at org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator.interpolate(LocaleContextMessageInterpolator.java:50)
      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 org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:207)
      at com.epam.extendedchat.validator.ValidatorTest.testIllegalNickLength(ValidatorTest.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:73)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:73)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:224)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
      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:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  </code></pre>