aspose file tools*
The moose likes JSF and the fly likes Beginner tutorial fail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Beginner tutorial fail" Watch "Beginner tutorial fail" New topic
Author

Beginner tutorial fail

Andrzej Cichon
Greenhorn

Joined: Nov 15, 2010
Posts: 9


index.jsp:


web.xml:


faces-config.xml:


UserBean.java:


logs:
2010-11-26 00:48:14 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_20\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.6.0_20/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_20/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_20/bin/../jre/lib/i386;D:\apache-maven-3.0\bin;C:\Program Files\Java\jdk1.6.0_20\bin
2010-11-26 00:48:15 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:przyklad' did not find a matching property.
2010-11-26 00:48:15 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:JSFtutorials' did not find a matching property.
2010-11-26 00:48:15 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
2010-11-26 00:48:15 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 924 ms
2010-11-26 00:48:15 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
2010-11-26 00:48:15 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26
2010-11-26 00:48:16 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
2010-11-26 00:48:16 org.apache.myfaces.webapp.StartupServletContextListener dispatchInitializationEvent
INFO: Checking for pluginsrg.apache.myfaces.FACES_INIT_PLUGINS
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON' found, using default value false
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS' found, using default value false
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE' found, using default value false
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS' found, using default value true
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getLongInitParameter
INFO: No context init parameter 'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.VIEWSTATE_JAVASCRIPT' found, using default value false
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Starting up Tomahawk on the RI-JSF-Implementation.
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Starting up Tomahawk on the MyFaces-JSF-Implementation
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
SEVERE: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator feedStandardConfig
INFO: Reading standard config META-INF/standard-faces-config.xml
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator feedWebAppConfig
INFO: Reading config /WEB-INF/faces-config.xml
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-api in version : 1.2.9 from path : file:/D:/Projekty/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/JSFtutorials/WEB-INF/lib/myfaces-api-1.2.9.jar
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-impl in version : 1.2.9 from path : file:/D:/Projekty/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/JSFtutorials/WEB-INF/lib/myfaces-impl-1.2.9.jar
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk12 not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox12 not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox15 not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : myfaces-orchestra-core not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : myfaces-orchestra-core12 not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : trinidad-api not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : trinidad-impl not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tobago not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : commons-el not found.
2010-11-26 00:48:16 org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : jsp-api not found.
2010-11-26 00:48:16 org.apache.myfaces.shared_impl.util.LocaleUtils toLocale
WARNING: Locale name in faces-config.xml null or empty, setting locale to default locale : pl_PL
2010-11-26 00:48:17 org.apache.myfaces.config.FacesConfigurator handleSerialFactory
INFO: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
2010-11-26 00:48:17 org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
INFO: ServletContext 'D:\Projekty\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\JSFtutorials\' initialized.
2010-11-26 00:48:17 org.apache.myfaces.webapp.StartupServletContextListener dispatchInitializationEvent
INFO: Checking for pluginsrg.apache.myfaces.FACES_INIT_PLUGINS
2010-11-26 00:48:17 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context '/JSFtutorials'
2010-11-26 00:48:18 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
2010-11-26 00:48:18 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
2010-11-26 00:48:18 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/156 config=null
2010-11-26 00:48:18 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2937 ms
2010-11-26 00:48:19 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.RuntimeException: Cannot find FacesContext
at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1797)
at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1614)
at org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:99)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)


What do i do wrong?
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Don't really know how to help you, but it looks like the Tomcat libraries haven't been located at runtime
so they're not on the classpath. Which IDE are you using? More importantly, why on earth, if you are a
beginner are you using JSF 1.1? Is this a corporate requirement? I wouldn't want to be using it.

B.
Andrzej Cichon
Greenhorn

Joined: Nov 15, 2010
Posts: 9
Brendan Healey wrote:Don't really know how to help you, but it looks like the Tomcat libraries haven't been located at runtime
so they're not on the classpath. Which IDE are you using? More importantly, why on earth, if you are a
beginner are you using JSF 1.1? Is this a corporate requirement? I wouldn't want to be using it.

B.

I'm using Eclipse Helios.
Which JSF should I use and how to add Tomcat libraries to the classpath?
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
In you log it reads
"SEVERE: Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations."

So you have both the Sun reference implementation and the Apache MyFaces in you classpath. Remove the other.

I do not know why Brendan Healey thinks that the Tomcat libraries are missing. I do not see any errors that imply that.

And I personally would start with JSF 2.0 and with JSF 2.0 examples and in fact I did when I started using JSF a while ago.
http://www.coreservlets.com/JSF-Tutorial/jsf2/
 
 
subject: Beginner tutorial fail