java.lang.IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory


In Eclipse IDE, while deploying a JSF 2.0 web application to Tomcat 6.0.26, hits the following exception and failed to start the Tomcat server.

P.S Both jsf-api-2.1.0-b03.jar and jsf-impl-2.1.0-b03.jar libraries are included in the project classpath.

INFO: Unsanitized stacktrace from failed start...
java.lang.IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory
	at javax.faces.FactoryFinder.validateFactoryName(
	at javax.faces.FactoryFinder.setFactory(
SEVERE: Critical error during deployment: 
CONFIGURATION FAILED! javax.faces.context.ExceptionHandlerFactory
Caused by: java.lang.IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory
	at javax.faces.FactoryFinder.validateFactoryName(


In Eclipse debugging mode, dig inside the source code, find out the IllegalArgumentException is thrown by the FactoryFinder’s getFactory() method.

 * @throws IllegalArgumentException if <code>factoryName</code> does not
 *                                  identify a standard JavaServer Faces factory name
 * @throws IllegalStateException    if there is no configured factory
 *                                  implementation class for the specified factory name
 * @throws NullPointerException     if <code>factoryname</code>
 *                                  is null
 public static Object getFactory(String factoryName)
         throws FacesException {


The IllegalArgumentException documented that the factor finder does not recognize the new JSF2.0 ExceptionHandlerFactory factory name.

After thousand times of testing and trying, finally, i find out the root cause is from the javaee.jar, which included in my project class path. Look inside the javaee.jar, it contains a set of JSF 1.2 api as well, look like the Tomcat is picking this JSF 1.2 api instead of my new JSF 2.0 api.

After remove the javaee.jar from the project classpath, the JSF 2.0 web application is able to start and running well on Tomcat.


  1. FactoryFinder.html#getFactory Javadoc
  2. JSF 2.0.3 release notes

About the Author

author image
Founder of, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.


4 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
InayathullaVersion hell with JSFUnit, Arquillian, and (embedded) Glassfish and other containers « The Holy JavaJSF 2.0 TutorialsJSF 2.0 hello world example Recent comment authors
newest oldest most voted

Good Job mkyong!

Version hell with JSFUnit, Arquillian, and (embedded) Glassfish and other containers « The Holy Java

[…] It seems that you can test only JSF 2.0 applications (well, you hopefully will be able to test them once Beta2 is out); if you try to test a JSF 1.2 application you will run into conflicting APIs, resulting for example in IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory. […]

JSF 2.0 Tutorials

[…] java.lang.IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory […]

JSF 2.0 hello world example

[…] java.lang.IllegalArgumentException: javax.faces.context.ExceptionHandlerFactory […]