facebook

jsfdemo question

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #241260 Reply

    jetzzz
    Member

    I am a jsf newbie using jboss-4.0.3 and my eclipse 4.0.1
    I follow the each step in jsf tutorial and deploy the project, can’t get it work, I searched all the forum here, still can’t find the
    reason.

    deploy response

    09:54:38,759 INFO [TomcatDeployer] deploy, ctxPath=/mynew, warUrl=…/deploy/mynew.war/
    09:54:41,567 WARN [Digester] [NavigationRuleRule]{faces-config/navigation-rule} Merge(/userLogin.jsp)
    09:54:41,583 WARN [Digester] [NavigationRuleRule]{faces-config/navigation-rule} Merge(/userLoginSuccess.jsp)
    09:54:41,583 WARN [Digester] [ManagedBeanRule]{faces-config/managed-bean} Merge(UserBean)
    09:58:00,500 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
    09:58:00,718 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
    09:58:00,734 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
    09:58:00,796 ERROR [LocaleUtils] Locale name null or empty, ignoring
    09:58:01,077 INFO [StartupServletContextListener] ServletContext ‘C:\jboss-4.0.3\server\default\.\deploy\mynew.war\’ initialized.

    couldn’t get it work, here is the result:

    09:58:56,043 ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    09:58:56,059 ERROR [[jsp]] Servlet.service() for servlet jsp 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.userLogin_jsp._jspx_meth_f_view_0(org.apache.jsp.userLogin_jsp:131)
    at org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:105)
    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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    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)

    09:58:56,059 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet 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.userLogin_jsp._jspx_meth_f_view_0(org.apache.jsp.userLogin_jsp:131)
    at org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:105)
    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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    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)

    1. I did initialized the facesservlet in web.xml, map *.faces to faces servlet.
    2. I did use useLogin.faces to access
    3. I added the h:form tag in userLogin.jsp
    4. my web.xml and faces-config.xml are exactly the same as the demo project I downloaded from the website.
    I know it might be config problem but I followed each step in the tutorial and google the error online, really can’t figure it out, need help. thanks

    #241324 Reply

    Riyad Kalla
    Member

    If you download and install Tomcat locally and then depkloy to it instead of JBoss, does the app work?

    HINT: Download the Tomcat zip, and unzip it, then go set it up in MYEclipse, that’s all you need to do to “install it”

    #241393 Reply

    xpcoming
    Member

    I have the same problem. Need somebody’s help!

    #241408 Reply

    Riyad Kalla
    Member

    xpcoming,
    There is no way we could start to help you without any information about your setup, web.xml file, faces-config.xml file, the EXACT error you get, app server, etc. etc.

    #242444 Reply

    datapulse
    Member

    I am also getting the same problem with Tomcat 5.5 running within Eclipse. Hope the following is enough info.

    <SNIP>

    #242450 Reply

    datapulse
    Member

    <SNIP>

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

    faces-config.xml
    ================

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE faces-config PUBLIC “-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN” “http://java.sun.com/dtd/web-facesconfig_1_1.dtd”&gt;

    <faces-config >
    <managed-bean>
    <managed-bean-name>UserBean</managed-bean-name>
    <managed-bean-class>uk.co.tyke.hannahshairdos.UserBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>username</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
    </managed-property>
    <managed-property>
    <property-name>password</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
    </managed-property>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/userLogin.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/userLoggedin.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>failure</from-outcome>
    <to-view-id>/userLogin.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/userLoggedin.jsp</from-view-id>
    </navigation-rule>
    </faces-config>

    stack trace
    ===========
    01-Dec-2005 21:19:57 javax.faces.webapp.UIComponentTag setupResponseWriter
    SEVERE: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    01-Dec-2005 21:19:57 org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp 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.userLogin_jsp._jspx_meth_f_view_0(org.apache.jsp.userLogin_jsp:130)
    at org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:105)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    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:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    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.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:868)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)

    #242452 Reply

    Riyad Kalla
    Member

    datapulse,
    1) That was a very obnoxious post, to simply dump every single line of configuration you could find polutes a thread for no good reason and makes it hard for us to distill it all and for others to follow. We outline the questions we wanted answered in our posting guidelines, and if you miss that we also provide the MyEclipse > About > Configuration Summary functionatliy. I am not asking you to repost this info, but pointing that out if you need to post your information in the future.
    2) What URL are you using in your browser to access your page, make sure you are not trying to access the .jsp file directly (http://localhost/myapp/login.jsp) that will cause this exception, you need to use the extension you mapped: http://localhost/myapp/login.faces

    #242468 Reply

    datapulse
    Member

    Yes, it probably was an obnoxious post. It was in direct response to the terse and impolite response you gave to xpcoming. Looking back I gave the information you asked xpcoming for, even though the answer is apparently a one liner and did not need it.

    The end result is that I got an answer, while xpcoming and jetzzz are still waiting.

    regards,

    #242473 Reply

    Riyad Kalla
    Member

    The end result is that I got an answer, while xpcoming and jetzzz are still waiting.

    If you re-read the thread, both of their posts were followed up to and they never replied.

    It was in direct response to the terse and impolite response you gave to xpcoming.

    It could have been more welcoming, I agree.

    Looking back I gave the information you asked xpcoming for, even though the answer is apparently a one liner and did not need it.

    In this particular case no we didn’t need more info, but had you replied “I already tried that”, I figured I’d get the rest of the information up front to shorten your wait for an answer.

    #242481 Reply

    datapulse
    Member

    Maybe I was a little OTT. However (and this is meant constructively, not to further this thread) it is annoying for a developer when a support dept ask you for a whole load of information that does not seem appropriate to the particular case. I have seen it when working in support that this is done in the hope the punter will not come back. I not accusing anyone at myEclipse of that, the support given has always been excellent.

    #242828 Reply

    noodnik2
    Member

    OK one more developer hoping to get an answer here. I’m getting the same thing. Also JBoss 4.0.3 running JDK1.5.0_06, MyEclipse 4.1M1, Eclipse 3.1.1, vanilla “JSF” project simple JSP based upon JSF Template, deleted “INSERT YOUR BUNDLE HERE” line, called with *.faces URL (e.g. instead of my.jsp I entered “my.faces”; just like the other user said he did).

    Any info or the answer will be appreciated. Thanks.

    #242829 Reply

    noodnik2
    Member

    It’s clear from the following log entries that a faces context is being created:

    […]
    2005-12-08 00:06:50,046 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: FirstWeb.war
    2005-12-08 00:06:50,046 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/StupidProgramFiles/jboss-4.0.3SP1/server/default/deploy/FirstWeb.war/
    2005-12-08 00:06:59,230 DEBUG [com.sun.faces.lifecycle.LifecycleImpl] execute(com.sun.faces.context.FacesContextImpl@fd2254)
    2005-12-08 00:06:59,230 DEBUG [com.sun.faces.lifecycle.LifecycleImpl] phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@fd2254)
    2005-12-08 00:06:59,230 DEBUG [com.sun.faces.lifecycle.RestoreViewPhase] Entering RestoreViewPhase
    2005-12-08 00:06:59,260 DEBUG [com.sun.faces.application.ViewHandlerImpl] servletPath /SampleReport1.faces
    […]

    However, it appears that some JSF tag is not able to find the context, though… Observe the following log snippet:

    […]
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.lifecycle.RenderResponsePhase] Entering RenderResponsePhase
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.lifecycle.RenderResponsePhase] About to render view /SampleReport1.faces
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.application.ViewHandlerImpl] About to render view /SampleReport1.faces
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.application.ViewHandlerImpl] URL pattern of the FacesServlet executing the current request .faces
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.application.ViewHandlerImpl] Found URL pattern mapping to FacesServlet .faces
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.application.ViewHandlerImpl] viewId after appending the context suffix /SampleReport1.jsp
    2005-12-08 00:06:59,310 DEBUG [com.sun.faces.application.ViewHandlerImpl] Before dispacthMessage to newViewId /SampleReport1.jsp
    2005-12-08 00:06:59,340 DEBUG [org.jboss.web.tomcat.tc5.jasper.TagLibCache] Scanning for tlds in: file:/C:/StupidProgramFiles/jboss-4.0.3SP1/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs/myfaces-impl.jar
    2005-12-08 00:07:00,241 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.
    2005-12-08 00:07:00,241 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/FirstWeb].[jsp]] Servlet.service() for servlet jsp 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.SampleReport1_jsp._jspx_meth_f_view_0(org.apache.jsp.SampleReport1_jsp:109)
    at org.apache.jsp.SampleReport1_jsp._jspService(org.apache.jsp.SampleReport1_jsp:84)
    […]

    Any apropos observation or insight appreciated! Thanks.

    #242845 Reply

    Riyad Kalla
    Member

    noodnik2,
    I believe the problem is that JBoss ships JSF JARs with it’s install, and there might be a conflict.

    The quickest way to see “what’s up” is to go download Tomcat 5.5.9, unzip it somewhere (get the zip, not the EXE), setup your Tomcat 5 connector, deploy your project to Tomcat 5 and fire it up, does it work? If so, check our your JBoss lib directories, I believe another user had this exactly same issue a few weeks ago and it turned out his project’s JSF impl was conflicting with the ones provided by the app server.

    #242846 Reply

    Riyad Kalla
    Member

    noodnik2,
    I saw that you found the thread: https://www.genuitec.com/forums/topic/problems-with-jsflogindemo/#post-242831

    Are you up and running now?

    #243594 Reply

    YellowDog
    Member

    I was having the same problem in a Tomcat 5 server. However my app is my own creation, not a sample. In index.jsp I had this code:

    <%
    String url = response.encodeRedirectURL("jsp/greeting.jsp");
    response.sendRedirect(url);
    %>
    

    Changing the extension of the target file to “faces” solved my problem (my deployment descriptor maps the servlet to *.faces).

    BTW, the sendRedirect() method does not seem to like absolute path names (e.g. /jsp/greeting.faces). I get a 404 – Not Found.

Viewing 15 posts - 1 through 15 (of 19 total)
Reply To: jsfdemo question

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