1 2 Previous Next 18 Replies Latest reply on Jul 20, 2006 9:49 AM by rfidler1978 Go to original post
      • 15. Re: ERROR [javax.faces.webapp.UIComponentTag] Faces context
        Jubilee Miremba Newbie

        I was having the same Faces Context problem with JSF apps developed on NetBeans 5.0 and deployed to JBoss-4.0.3SP1. Even after moving to JBoss-4.0.2, I still see the same problem. Was anyone ever able to resolve this problem?

        • 16. Re: ERROR [javax.faces.webapp.UIComponentTag] Faces context
          niki todorov Newbie

          Ok, if I'm not missing something, I have the same problem when trying to use JSF tags:

          root cause

          13:14:44,918 ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
          13:14:44,921 ERROR [[mainJsp]] Servlet.service() for servlet mainJsp threw exception
          java.lang.NullPointerException
          at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
          at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
          at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
          at org.apache.jsp.jsp.main_jsp._jspx_meth_f_view_0(org.apache.jsp.jsp.main_jsp:161)
          at org.apache.jsp.jsp.main_jsp._jspService(org.apache.jsp.jsp.main_jsp:118)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
          at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
          at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
          at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
          at java.lang.Thread.run(Thread.java:595)


          I updated my web.xml with:


          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>


          <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.jsf</url-pattern>
          </servlet-mapping>


          <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>


          Any help?

          • 17. Re: ERROR [javax.faces.webapp.UIComponentTag] Faces context
            niki todorov Newbie

            Hi again. I managed to ran my application. I am not very sure what is the reason but.... here is my adventure:

            I removed from jboss-4.0.3SP1/server/default/deploy/jbossweb-tomcat55.sar jsf-libs dir.

            I put all necessary libs in my web application, which are

            jsf-api.jar
            jsf-impl.jar

            and

            myfaces-impl.jar, which I took from jboss-4.0.3SP1/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs before removing it, because I had a Class not foun exception.

            After all this I tryied again with my URL: http://localhost:8080/TestWebApp/mainJsp

            the following exception appeared:

            javax.servlet.jsp.JspException: Cannot find FacesContext
            javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
            com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
            org.apache.jsp.jsp.main_jsp._jspx_meth_f_view_0(org.apache.jsp.jsp.main_jsp:170)
            org.apache.jsp.jsp.main_jsp._jspService(org.apache.jsp.jsp.main_jsp:127)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


            Then I tryied the following URL: http://localhost:8080/TestWebApp/faces/mainJsp ..... and everything is now OK !!!!!!

            I am not sure, that I understand what happened as my jsp is defined in web.xml as:

            <servlet-mapping>
            <servlet-name>mainJsp</servlet-name>
            <url-pattern>/mainJsp</url-pattern>
            </servlet-mapping>

            so the last URL must not be walid, although the Face servlet is mapped:

            <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
            </servlet-mapping>

            Then I tried to map Face Servlet in the following way (guess why)

            <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/*.jsp</url-pattern>
            </servlet-mapping>

            not working:

            java.lang.reflect.InvocationTargetException
            at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:921)
            at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:578)
            at org.apache.tomcat.util.digester.Rule.end(Rule.java:228)
            at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057)
            at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown S


            Can anyone explain me all this.

            • 18. Re: ERROR [javax.faces.webapp.UIComponentTag] Faces context
              Newbie

              Just to dump in two cents....

              I was receiving the same error when moving a webapp from Tomcat standalone to JBoss 4.0.4 GA. When looking at the existing web.xml I noticed that some properties that were set using net.sourceforge.myfaces. Recalling from some JBoss JSF documentation that the default JSF implementation was provided by Apache, I looked into which library Tomcat (embedded) was using - and behold it was Apache's implementation.

              Now I would think that having the net.sourceforge implementation in my WEB-INF would prompt Tomcat to use that impl, but it didn't. When I replaced the default Apache impl with the net.sourceforge everything was fine.

              How to change jsf impl:

              Section 9.9 of:
              http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html

              (thanks to a previous post for providing this URL)

              Afore mentioned tag lib issue might still be an issue but for me it was just the JSF implementation.

              1 2 Previous Next