*
The moose likes JSF and the fly likes java.lang.NoClassDefFoundError: javax/faces/FactoryFinder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "java.lang.NoClassDefFoundError: javax/faces/FactoryFinder" Watch "java.lang.NoClassDefFoundError: javax/faces/FactoryFinder" New topic
Author

java.lang.NoClassDefFoundError: javax/faces/FactoryFinder

J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
I'm trying to set up a new project to play around with at home but, for some reason, can't get it up and running. I'm using:

  • Eclipse J2EE Indigo
  • JSF 1.2
  • Richfaces 3.3.3
  • Tomcat v6.0


  • Here's the list of JAR's that I have brought into my lib folder.
  • commons-beanutils-1.7.0.jar
  • commons-collections-3.2.1.jar
  • commons-digester-1.8.jar
  • commons-logging.jar
  • jhighlight-1.0.jar
  • richfaces-api-3.3.3.Final.jar
  • richfaces-impl-3.3.3.Final.jar
  • richfaces-ui-3.3.3.Final.jar



  • When I start up my server, this is what I'm getting:



    I've done some searching around on the web, and can't find a solution. I've also tried deleting my project and creating a new one, no luck. Anyone have any ideas?
    J Miller
    Ranch Hand

    Joined: Oct 21, 2010
    Posts: 67
    Ok, so just in case anybody else comes across this, I had to add:

  • jsf-api.jar
  • jsf-impl.jar


  • Once those jars were added to the project, error went away.
    Tim Holloway
    Saloon Keeper

    Joined: Jun 25, 2001
    Posts: 16250
        
      21

    The reason that you had to do that is because Tomcat does not implement the full JEE spec. You would not include the JSF jars if you were running JBoss AS 5, for example even though it uses an embedded Tomcat. That's because JBoss is a full-stack JEE server and has its own JSF implementation classes built in, unlike stand-alone Tomcat.


    Customer surveys are for companies who didn't pay proper attention to begin with.
    J Miller
    Ranch Hand

    Joined: Oct 21, 2010
    Posts: 67
    Ok, good to know. It's harder to find good information about getting a JSF project set up from the ground up, and almost impossible to find info on what to do if things go awry.
    Tim Holloway
    Saloon Keeper

    Joined: Jun 25, 2001
    Posts: 16250
        
      21

    One of the best ways to get up and running quickly is to use a Maven archetype to generate the project. That will at least ensure that the basics are all there and in the right place. Maven can also generate the support files for some of the better-known IDEs while it's at it.

    As the JSF standard firms up, we will gradually see the extra kinks that come from different server flavors and versions fade away and it can happen none too soon, as far as I am concerned.

    Of course even then we have the issues that while JSF is designed to make things as simple as possible, the simplicity only works if one has a solid grounding in the basics of JSF - especially the JSF lifecycle and don't get trapped by outdated documentation pulled from the Internet. Too many people over-complicate their JSF code because they either don't understand basic HTTP request/response and the JSF lifecycle, don't realize that the more JSF-specific the code is, the more likely it's not done well, or because they (presumably) don't think that things could be that easy.
    William P O'Sullivan
    Ranch Hand

    Joined: Mar 28, 2012
    Posts: 859

    The JSF jars are needed to implement core JSF functionality.

    "faces" enhances JSF (rich, ice.. etc.)

    WP
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: java.lang.NoClassDefFoundError: javax/faces/FactoryFinder