This seems to be a problem when an application includes Tomcat in
embedded mode.
The issue seems to occur because the development environment wants to
include classes twice. Once within the war file for the webapp and one
in the main application.
This double-loading appears to generate this error upon deployment.

John

-----Original Message-----
From: John [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 13, 2006 11:59 AM
To: MyFaces Discussion; Daniel Haensse
Subject: RE: Servlet and myfaces

Yes yes...
This method (as posted in many examples), simply results in:

 java.lang.NoClassDefFoundError: javax/faces/FactoryFinder

My particular use is within a servlet filter.
Doesn't work.

John

-----Original Message-----
From: Daniel Haensse [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 13, 2006 3:49 AM
To: MyFaces Discussion
Subject: Re: Servlet and myfaces

Hey Dani,

that is really a greenhorn's question ;-)

check this
http://wiki.apache.org/myfaces/AccessFacesContextFromServlet
http://mail-archives.apache.org/mod_mbox/myfaces-users/200606.mbox/%3C00
[EMAIL PROTECTED]

The servled would look like this, the managed bean has the name
"appModel" and class AppModel in this example

public class CompressImages extends AbstractFacesServlet {
         protected void processRequest(HttpServletRequest request,
                         HttpServletResponse response) throws
ServletException, IOException {
                // Get faces context
            FacesContext facesContext = getFacesContext(request,
response);
            AppModel appModelBean = (AppModel) 
getManagedBean("appModel",facesContext);                

            // We only serve request with valid session !!!
            if (appModelBean==null) {
                java.util.logging.Logger.global.info("Bean is null.");
                return;
                } 
            else {
                        java.util.logging.Logger.global.info("Got
bean.");
                }               

regards

Dani


Reply via email to