org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0

环境:SSM+Tomcat7+Maven
在使用org.hibernate.validator的标签限制对象的字符值的时候,出现当下错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/el/ELManager
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactoryKaTeX parse error: Expected group after '_' at position 742: …icationContext._̲_refresh(Abstra…AbstractConnectionHandler.process(AbstractProtocol.java:637)
org.apache.tomcat.util.net.AprEndpoint S o c k e t P r o c e s s o r . d o R u n ( A p r E n d p o i n t . j a v a : 2549 ) o r g . a p a c h e . t o m c a t . u t i l . n e t . A p r E n d p o i n t SocketProcessor.doRun(AprEndpoint.java:2549) org.apache.tomcat.util.net.AprEndpoint SocketProcessor.doRun(AprEndpoint.java:2549)org.apache.tomcat.util.net.AprEndpointSocketProcessor.run(AprEndpoint.java:2538)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 617 ) o r g . a p a c h e . t o m c a t . u t i l . t h r e a d s . T a s k T h r e a d Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread Worker.run(ThreadPoolExecutor.java:617)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)

org.hibernate.validator版本:


  
    org.hibernate.validator
    hibernate-validator
    6.0.9.Final
  
  
    javax.validation
    validation-api
    2.0.1.Final
  

尝试pom.xml添加了依赖后仍然无法解决问题:

 
    javax.el
    javax.el-api
    3.0.0
  

后来查看了Tomcat的版本支持信息,原使用tomcat7版本和el3.0的版本,查看了tomcat对其他规范确实 是自己没有留意到版本的问题,一味的追求高版本,谨记以后多看看文档。
org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0_第1张图片

你可能感兴趣的:(SpringMVC)