java.lang.NoSuchMethodError: org.apache.el.lang.ELSupport.coerceToType (Ljavax/el/ELContext; Ljava/lang/Object; Ljava/lang/Class;) Ljava/lang/Object;




Asked on March 12, 2016
I am creating an application integrating Spring security and JSF 2. While running the application, I am getting error. What am I missing?

java.lang.NoSuchMethodError: org.apache.el.lang.ELSupport.coerceToType(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
at org.apache.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:47)
at javax.el.ELContext.convertToType(ELContext.java:232)
at org.apache.el.ValueExpressionLiteral.getValue(ValueExpressionLiteral.java:56)
at com.sun.faces.facelets.impl.DefaultFaceletContext.getAttribute(DefaultFaceletContext.java:294)
at com.sun.faces.facelets.tag.jsf.IterationIdManager._getStackOfTrackedIds(IterationIdManager.java:67)
at com.sun.faces.facelets.tag.jsf.IterationIdManager.startNamingContainer(IterationIdManager.java:52)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:198)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)



Replied on March 12, 2016
The error is because of more than one EL version exits in the application. If using spring boot, there is tomcat-embed-el which consist ELSupport class and external tomcat already consist EL jar. So if using external Tomcat, exclude embed tomcat. In case  gradle is being used, you can exclude as 

providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat:1.3.3.RELEASE' 


Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us