GeeCON Prague 2014*
The moose likes JSF and the fly likes jsf, eclipse, and tomcat 6.0 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "jsf, eclipse, and tomcat 6.0 problem" Watch "jsf, eclipse, and tomcat 6.0 problem" New topic
Author

jsf, eclipse, and tomcat 6.0 problem

Michael Lee Jordan
Greenhorn

Joined: Sep 03, 2008
Posts: 14
I am new to jsf and eclipse. I tried to build an application with jsf using eclipse IDE. However, whenever i tried to run a test index.jsp page, i always get the following server error:

SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener

I have done a lot of research and included the following jars in the web-inf/lib directory

commons-beanutils.jar
commons-collection.jar
commons-digest.jar
commons-loggin.jar
jsf-api.jar
jsf - impl.jar
standard.jar
jstl.jar

but could NOT make it work. Anyone with any thought?
I really appreciate it.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Michael Lee Jordan:
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
You're likely mixing different JSF implementations. Don't do that. Use one implementation. Thus not for example having both Sun Mojarra and Apache MyFaces in the classpath, but only one of them.

You may want to consider a startover using this tutorial: http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html. It covers the newest Sun JSF version which doesn't require the commons stuff (which it didn't since 1.2_05).
[ September 03, 2008: Message edited by: Bauke Scholtz ]
Michael Lee Jordan
Greenhorn

Joined: Sep 03, 2008
Posts: 14
Thanks for the link.

I followed what the tutorial says and this time, i could n't start the tomcat server. I got the error while trying to start the server

SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.compiler.JspRuntimeContext

Does that mean new apis jars need to be included?

Thanks
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Did you run it from Eclipse? If so, did you integrate it properly, exactly as stated in the tutorial? Sounds like that you didn't let Eclipse take control of Tomcat (select "Use Tomcat installation" under "Server locations" in Eclipse Tomcat configuration).

Or did you run it from command console? If so, then you'll have to set some environment variables such as JAVA_HOME and CATALINA_HOME. Consult Tomcat documentation for details.
Michael Lee Jordan
Greenhorn

Joined: Sep 03, 2008
Posts: 14
Thanks!

I got it working. In fact, the problem lied with missing a jsp-api.jar in the tomcat\lib -- after I downloaded it moved it to the folder, everything seems to be working now.

I will need to pass the tutorial to others interested.
Victor Chirita
Greenhorn

Joined: Jun 02, 2011
Posts: 1
I confirm that by mixing Mojarra 2.0 and Apache Myfaces JSF Core 2.0 Api one would get the above error.
 
Consider Paul's rocket mass heater.
 
subject: jsf, eclipse, and tomcat 6.0 problem