facebook

JSF example doesn’t work

💡
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. General Development
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #253490 Reply

    Edward Tsai
    Member

    Dear Sir,

    I’m learning JSF using JSFLoginDemo from you step by step, but I encounter the following error message:

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    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)
    com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

    root cause

    java.lang.NullPointerException
    javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
    javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
    org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
    org.apache.jsp.userLogin_jsp._jspx_meth_f_view_0(org.apache.jsp.userLogin_jsp:130)
    org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:105)
    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)
    com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.

    I use JBoss 4 with package archived deploy type.

    Thanks for your help in advance.

    Best,
    Edward Tsai

    #253499

    Riyad Kalla
    Member

    Edward,
    What URL are you using to access your webpage? (The exact one from your browser)

    #253508

    Edward Tsai
    Member
    #253518

    Riyad Kalla
    Member

    We just recieved an email about this exact question this morning at our support@ address, was that you? (in which case the issue was resolved) or no?

    #253531

    Edward Tsai
    Member

    I posted the URL I used yesterday. The problem is not solved yet.

    #253532

    Riyad Kalla
    Member

    Can you export your project to an archive and email it to suport@myeclipseide.com ATTN Riyad with a link to this forum so I know why I’m getting it, I’ll have a look.

    #253578

    Edward Tsai
    Member

    I’ve downloaded the sample project JSFLoginDemoProject and import into MyEclipse IDE and tried again, but got the same error message as above. Does this mean there should be something wrong in my MyEclipse environment? Please advise, thanks.

    Edward Tsai

    #253592

    Riyad Kalla
    Member

    Edward,
    My guess is that there is something wrong with your Tomcat install. I would suggest doing a fresh install of TOmcat to a new directory to rule out any 3rd party libraries installed.

    #253678

    Edward Tsai
    Member

    I have reinstalled eclipse 3.1.2, and then reinstalled myeclipse 4.1.1, and then downloaded and reinstalled JBoss 4.0.4. And I tried to run JSFLoginDemo again, I got the similar error message as below:

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Exception in JSP: /userLogin.jsp:11

    8: <title>My JSF ‘userLogin.jsp’ starting page</title>
    9: </head>
    10: <body>
    11: <f:view>
    12: <f:loadBundle basename=”com.jsfdemo.MessageBundle” var=”bundle”/>
    13:
    14: <h:form id=”loginForm”>

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
    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)
    com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

    root cause

    java.lang.NullPointerException
    javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
    javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
    org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
    org.apache.jsp.userLogin_jsp._jspx_meth_f_view_0(userLogin_jsp.java:112)
    org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:87)
    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:332)
    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)
    com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

    ——————————————————————————–

    Apache Tomcat/5.5.1

    Thanks for your help.

    Best,
    Edward TSai

    #253685

    Riyad Kalla
    Member

    Edward,
    In your web.xml file, what extension did you map the FacesServlet to? What URL are you using to access your JSP page? If f:view is throwing the exception my guess is that you are either trying to access the page using the .jsp extension in which case you are removing the FacesServlet from the process loop and f:view is dying because it cannot find the FacesContext or your setup is borked.

    #253719

    Edward Tsai
    Member

    the web.xml context is as below:

    <?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;
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <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>

    The faces-config.xml content is as below:

    <?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>
    <navigation-rule>
    <from-view-id>/userLogin.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/userLoginSuccess.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>
    <managed-bean>
    <description>Bean used to handle all User-based operations.</description>
    <managed-bean-name>UserBean</managed-bean-name>
    <managed-bean-class>com.jsfdemo.bean.UserBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </faces-config>

    and the URL I used is “http://localhost:8080/JSFLoginDemo/userLogin.faces&#8221;

    Thanks for your great help again.

    Best,
    Edward Tsai

    #253750

    Riyad Kalla
    Member

    Everything looks good. If you look in your Tomcat/lib, common/lib or server/lib directories, do you see any JSF JARs? There shouldn’t be any.

    #253844

    Edward Tsai
    Member

    Dear Riyad,

    I only found 2 JSF JARs under JBoss installation directory, which are jsf-impl.jar and jsf-api.jar in the following directory:
    F:\jboss-4.0.4.GA\server\default\deploy\JSFLoginDemo.war\WEB-INF\lib

    Best,
    Edward Tsai

    #253873

    Riyad Kalla
    Member

    Strange, all of that looks OK.

    Can you export your project to a ZIP file and email it to me at support@genuitec.com ATTN Riyad with a link to this post so I know why I’m getting it?

    #255404

    Riyad Kalla
    Member

    This message has not been recovered.

Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: JSF example doesn’t work

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