Wednesday, November 25, 2009

java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

Problem with Running facelets

Environments : JBoss 4.2.0
Error : java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

Cause of Error : If we are getting such error while trying to run facelets with JBoss Server, then
the most probable cause for this is the library not included in path.

make sure you include these libraries\jars in \WEB-INF\lib folder.

commons-beanutils
commons-collections
commons-digestor
commons-logging
el-api
el-impl
el-ri
jsf-facelets-1.0

With JBoss we dont need to include jsf libraries and jstl libraries.
Including above libraries should eliminate the error.
Note : Check if the JBoss distribution contains commons-collections and commons-loggin In such case we dont need to include these in our project as they are already included with JBoss distribution. ReIncluding these jars can cause problems of conflict. Also check whether commons-el jar is present on the server distribution or not, In such case it is also not required to be included in the project as by default it will be included in the Project during build.
Thanks.