facebook

JSF tutorial

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

    Lockheed Martin
    Participant

    I am following the JSF tutorial http://www.myeclipseide.com/documentation/quickstarts/jsf/.

    My environment is:
    Version: 10.7.1
    Build id: 10.7.1-20130201

    32-bit installation on a Windows 7 64-bit machine.

    The tutorial was written with J2EE 1.4 with JSF 1.1 in mind. The cloest one I could get with my MyEclipse version is J2EE 1.4 with JSF 1.2. After I followed the tutorial and created all assets. I run it as MyEclipse server application. Tomcat 6 started. However, when I access the userLogin.faces URL I got the following error:

    message /JSFLoginDemo/userLogin.faces
    description The requested resource (/JSFLoginDemo/userLogin.faces) is not available.

    Questions:
    1. How do I trouble shoot this problem?
    2. Is there a newer tutorial for JSF 2 with a later version of EE version?

    Thanks.

    #338028 Reply

    Lockheed Martin
    Participant

    I believe that the error was caused by adding “MyEclipse JSF Facelet Capabilities”. I created a new project without adding that capability and was able to bring up the log-in page.

    #338033 Reply

    Lockheed Martin
    Participant

    Follow the tutorial and enter “myeclipse” as user name and password and attempt to login. I got a MethodNotFoundException: loginUser.

    Apr 15, 2013 11:34:52 AM com.sun.faces.renderkit.html_basic.HtmlBasicRenderer getForComponent
    WARNING: Unable to find component with ID ‘userName’ in view.
    Apr 15, 2013 11:34:53 AM com.sun.faces.renderkit.html_basic.HtmlBasicRenderer getForComponent
    WARNING: Unable to find component with ID ‘password’ in view.
    Apr 15, 2013 11:34:58 AM com.sun.faces.lifecycle.InvokeApplicationPhase execute
    SEVERE: #{userBean.loginUser}: javax.faces.el.MethodNotFoundException: loginUser
    javax.faces.FacesException: #{userBean.loginUser}: javax.faces.el.MethodNotFoundException: loginUser
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: javax.faces.el.MethodNotFoundException: loginUser
    at com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:199)
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:124)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    … 19 more

    Apr 15, 2013 11:34:58 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.el.MethodNotFoundException: loginUser
    at com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:199)
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:124)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:722)

    #338080 Reply

    CDL_LM,

    I could not replicate the issue at my end.

    The error looks like the loginUser method in userBean java file is not created. Can you please check whether the following java code was added to userBean.java file –

    public String loginUser() {
    if(“myeclipse”.equals(getUserName()) && “myeclipse”.equals(getPassword()))
    return “success”;

    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage facesMessage = new FacesMessage(
    “You have entered an invalid user name and/or password”);
    facesContext.addMessage(“loginForm”, facesMessage);

    return “failure”;
    }

    You can find the latest tutorials under Help > Help Contents. For JSF tutorial you can go to Help > Help Contents > MyEclipse Learning center > Developing web applications(AJAX,JSF STRUTS) > Tutorials > JSF. This tutorial is written with JSF 1.2 and Java 5.0.

    I have created JSFLoginDemo project with Java 6.0 and JSF 2.0 instead of JSF 1.2 and Java 5.0 and followed the rest from the tutorial and the demo project is successfully running. So, you can follow the JSF tutorial by selecting Java 6.0 and JSF 2.0.

    The latest release of MyEclipse, MyEclipse 2013 (formerly known as MyEclipse 11) is now available. Please take a look at this link for more information – https://www.genuitec.com/forums/topic/myeclipse-2013-is-now-available/

    Let us know how it works for you.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSF tutorial

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