Monday, August 19, 2013

How to manage with: INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.

The warning "The ELResolvers for JSF were not registered with the JSP container" thrown by JSF implementation layer has its source in class ELResolverInitPhaseListener in method populateFacesELResolverForJsp. This can occur when there can't be created appropriate instance of the Faces EL Resolver for JSF pages. As defined in JSF specification the implementation for the Faces ELResolver for JSP Pages is a set of ELResolvers inside of a CompositeELResolverinstance.

The main cause of cited error is any problem with implementation of ExpressionFactory. Faces 1.1 used the Application class as a factory for ValueBindingand and MethodBinding instances, but the Unified EL in JSF 1.2 and 2.* has the ExpressionFactory class instead as a factory for ValueExpression and MethodExpression instances.

The problem with ExpressionFactory denotes that Faces layer wasn't properly initialized. To resolve this error in the first check, if /WEB-INF/faces-config.xml configuration file is present and valid.


Additionaly in Faces 2.* and  Tomcat 6.0 you should perform additional steps:
  1. Download and put el-api2.* and el-impl2.* jar files in $TOMCAT_HOME/lib directory
  2. Register EL Factory in web.xml deployment descriptor:
<context-param>
     <param-name>com.sun.faces.expressionFactory</param-name>
     <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>

2 comments: