Maven Project starts the Tomcat times error:
2017-07-09 11:28:13,177 [RMI TCP Connection (5) -127.0.0.1] ERROR Org.springframework.web.context.ContextLoader- Context initialization failed org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Validator ' defined in file [{Project Path}Web-inf\classes\applicationcontext.xml]: Invocation of Init method failed; Nested exception is javax.validation.ValidationException:HV000183:Unable to initialize ' Javax.el.ExpressionFactory '. Check that to have the EL dependencies on the classpath, or with Parametermessageinterpolator instead at Org.springframew Ork.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1578) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:545) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:482) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:306) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) at Org.springframework.beans.factory.support.AbstrActbeanfactory.dogetbean (abstractbeanfactory.java:302) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:197) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:772) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:839) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:538) at
Org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (contextloader.java:444) At Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:326) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:107) at Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4206) at Org.apache.catalina.core.StandardContext.staRT (standardcontext.java:4705) at org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:799) At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:779) at Org.apache.catalina.core.StandardHost.addChild (standardhost.java:601) at ORG.APACHE.CATALINA.STARTUP.HOSTCONFIG.MANAGEAPP (hostconfig.java:1429) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.apache.tomcat.util.modeler.BaseModelMBean.invoke (basemodelmbean.java:297) at Com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (defaultmbeanserverinterceptor.java:819) at Com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (jmxmbeanserver.java:801) at Org.apache.catalina.mbeans.MBeanFactory.createStandardContext (mbeanfactory.java:631) at Org.apache.cataliNa.mbeans.MBeanFactory.createStandardContext (mbeanfactory.java:568) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.apache.tomcat.util.modeler.BaseModelMBean.invoke (basemodelmbean.java:295) at Com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (defaultmbeanserverinterceptor.java:819) at Com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (jmxmbeanserver.java:801) at Javax.management.remote.rmi.RMIConnectionImpl.doOperation (rmiconnectionimpl.java:1487) at javax.management.remote.rmi.rmiconnectionimpl.access$300 (rmiconnectionimpl.java:97) at Javax.management.remote.rmi.rmiconnectionimpl$privilegedoperation.run (rmiconnectionimpl.java:1328) at Javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation (rmiconnectionimpl.java:1420) at Javax.management.remote.rmi.RMIConnectionImpl.invoke (rmiconnectionimpl.java:848) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Sun.rmi.server.UnicastServerRef.dispatch (unicastserverref.java:322) at Sun.rmi.transport.transport$1.run ( transport.java:177) at Sun.rmi.transport.transport$1.run (transport.java:174) at Java.security.AccessController.doPrivileged (Native method) at Sun.rmi.transport.Transport.serviceCall ( transport.java:173) at Sun.rmi.transport.tcp.TCPTransport.handleMessages (tcptransport.java:556) at Sun.rmi.transport.tcp.tcptransport$connectionhandler.run0 (tcptransport.java:811) at Sun.rmi.transport.tcp.tcptransport$connectionhandler.run (tcptransport.java:670) at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) at Java.lang.Thread.run (thread.java:724) caused By:javax.validation.ValidationException:HV000183:Unable to initialize ' Javax.el.ExpressionFactory '. Check that to have the EL dependencies on the classpath, or with Parametermessageinterpolator instead at Org.hibernate.va Lidator.messageinterpolation.ResourceBundleMessageInterpolator.buildExpressionFactory ( RESOURCEBUNDLEMESSAGEINTERPOLATOR.JAVA:102) at Org.hibernate.validator.messageinterpolation.resourcebundlemessageinterpolator.<init> ( RESOURCEBUNDLEMESSAGEINTERPOLATOR.JAVA:45) at Org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultMessageInterpolator (Configurationimpl.java : 423) at Org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet ( localvalidatorfactorybean.java:238) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (Abstractautowirecapablebeanfactory.java:1637) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1574) ... More caused by:java.lang.NoSuchMethodError:javax.el.ExpressionFactory.newInstance () ljavax/el/expressionfactory
; At Org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.buildExpressionFactory ( resourcebundlemessageinterpolator.java:98) ... More
Workaround:
Add the El Package to the Pom.xml file and tell the following code to be copied into your Pom.xml
<dependency>
<groupId>javax.el</groupId>
<artifactid>javax.el-api</ artifactid>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId>
< Version>2.2.4</version>
</dependency>