facebook

JSF Newbie: JSFLoginDemo – Faces context not found

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #253580 Reply

    andrunix
    Member

    I am quite new to J2EE development so please forgive such a newbie question. I am trying to work through the JSFLoginDemo as well as a project from JavaServer Faces in Action by Kito Mann. I cannot get any JSF application working on JBoss 4.0.3SP1. I have gone through and double checked everything and I can’t figure this one out. My web.xml looks like this:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
      </context-param>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
    </web-app>
    

    When I run the application, I get this error in server.log:

    2006-06-18 10:36:09,906 DEBUG [com.sun.faces.application.ViewHandlerImpl] Found URL pattern mapping to FacesServlet .faces
    2006-06-18 10:36:09,906 DEBUG [com.sun.faces.application.ViewHandlerImpl] viewId after appending the context suffix /userLogin.jsp
    2006-06-18 10:36:09,921 DEBUG [com.sun.faces.application.ViewHandlerImpl] Before dispacthMessage to newViewId /userLogin.jsp
    2006-06-18 10:36:10,406 ERROR [javax.faces.webapp.UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    2006-06-18 10:36:10,406 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/JSFLoginDemo].[jsp]] Servlet.service() for servlet jsp threw exception

    I see that is says to check if the FacesServlet has been initialized in web.xml. As far as I can tell, it has.

    Thanks in advance for any help. If more detail is needed, I’ll be happy to provide.

    Andrew
    [/quote]

    #253583

    andrunix
    Member

    As I guessed, I am not the only one with this problem. I found this thread:

    https://www.genuitec.com/forums/topic/problems-with-jsflogindemo/#post-242831

    My apologies for reposting an old topic. I did search for this and couldn’t find it initially before posting.

    I have deployed the app to Tomcat 5 and it worked! That is the good news. The bad news is I still can’t get it to work on JBoss. I followed the instructions from JBoss here:

    http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWithIntegratedMyFaces

    and it still won’t work. Maybe I need to search down the “default” server path for MyFaces stuff.

    So, the problem is obviously a JBoss one. Any more infor on getting this to work would be helpful.

    Thanks.
    Andrew

    #253584

    andrunix
    Member

    I got it working on JBoss! I searched down the “default” server’s path and sure enough, there was that jsf-libs directory. I stopped the server, deleted that directory, restarted the server and it worked!

    Thanks to those who have struggeled with this and left me a trail.

    I hope this post helps someone else!

    Andrew

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: JSF Newbie: JSFLoginDemo – Faces context not found

You must be logged in to post in the forum log in