JSF example issues

Hi,

I am trying below JSF example from link

http://www.vogella.com/articles/JavaServerFaces/article.html


I do not see managed bean tab when i double click on the faces config. Do i need to enable anything to see it. I only see 3 tabs
1.Diagram
2.Tree
3. Source

When i click the Diagram and go to outline there are options like

Application, Factory, lifeCycle, Components, Converters,Manageed Beans(with right click option), Navigation Rules, Referred Beans, Render Kits, Validators, Extenstons. Not sure what they are for .

When i run the first application getting below error

Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config


do i need to have jstl-1.2.jar apart from jstl-api.1.2.jar, jstt-impl.1.2.jar and where i have to put them in
Build path?
or under
web-inf/lib
or both places
or some oher place and what is the difference in putting in these differenc palces.


I put three jars in java build path then user libraries and then copied to web-inf/lib folder still getting error as below

Sep 11, 2013 12:30:46 PM 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_41\bin;C:\software\eclipse-jee-juno-SR1-win32\eclipse;;.
Sep 11, 2013 12:30:47 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:de.vogella.jsf.first' did not find a matching property.
Sep 11, 2013 12:30:47 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Sep 11, 2013 12:30:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 762 ms
Sep 11, 2013 12:30:47 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 11, 2013 12:30:47 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
Sep 11, 2013 12:30:47 PM 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.
Sep 11, 2013 12:30:47 PM org.apache.myfaces.webapp.StartupServletContextListener dispatchInitializationEvent
INFO: Checking for plugins:org.apache.myfaces.FACES_INIT_PLUGINS
Sep 11, 2013 12:30:47 PM 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
Sep 11, 2013 12:30:47 PM 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
Sep 11, 2013 12:30:47 PM 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
Sep 11, 2013 12:30:47 PM 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
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.RENDER_VIEWSTATE_ID' found, using default value true
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.STRICT_XHTML_LINKS' found, using default value true
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig getLongInitParameter
INFO: No context init parameter 'org.apache.myfaces.CONFIG_REFRESH_PERIOD' found, using default value 2
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig getBooleanInitParameter
INFO: No context init parameter 'org.apache.myfaces.VIEWSTATE_JAVASCRIPT' found, using default value false
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
Sep 11, 2013 12:30:47 PM org.apache.myfaces.shared_impl.config.MyfacesConfig createAndInitializeMyFacesConfig
INFO: Starting up Tomahawk on the MyFaces-JSF-Implementation
Sep 11, 2013 12:30:47 PM org.apache.myfaces.config.FacesConfigurator feedStandardConfig
INFO: Reading standard config META-INF/standard-faces-config.xml
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator feedWebAppConfig
INFO: Reading config /WEB-INF/faces-config.xml
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-api in version : 1.2.9 from path : file:/C:/Users/ganesha/eclipseJuno_workspace/ljn_servletsJsp/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/de.vogella.jsf.first/WEB-INF/lib/myfaces-api-1.2.9.jar
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-impl in version : 1.2.9 from path : file:/C:/Users/ganesha/eclipseJuno_workspace/ljn_servletsJsp/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/de.vogella.jsf.first/WEB-INF/lib/myfaces-impl-1.2.9.jar
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk12 not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox12 not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk-sandbox15 not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : myfaces-orchestra-core not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : myfaces-orchestra-core12 not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : trinidad-api not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : trinidad-impl not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tobago not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : commons-el not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : jsp-api not found.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.shared_impl.util.LocaleUtils toLocale
WARNING: Locale name in faces-config.xml null or empty, setting locale to default locale : en_US
Sep 11, 2013 12:30:48 PM org.apache.myfaces.config.FacesConfigurator handleSerialFactory
INFO: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
Sep 11, 2013 12:30:48 PM org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
INFO: ServletContext 'C:\Users\ganesha\eclipseJuno_workspace\ljn_servletsJsp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\de.vogella.jsf.first\' initialized.
Sep 11, 2013 12:30:48 PM org.apache.myfaces.webapp.StartupServletContextListener dispatchInitializationEvent
INFO: Checking for plugins:org.apache.myfaces.FACES_INIT_PLUGINS
Sep 11, 2013 12:30:48 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Sep 11, 2013 12:30:48 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Sep 11, 2013 12:30:48 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/42  config=null
Sep 11, 2013 12:30:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1388 ms
Sep 11, 2013 12:30:49 PM javax.faces.webapp._ErrorPageWriter handleThrowable
SEVERE: An exception occurred
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:335)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
      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:103)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      ... 16 more



After more debugging getting errors like
 javax.servlet.ServletException: javax.servlet.jsp.JspException: java.io.IOException: Illegal to flush within a custom tag

Document root element "faces-config", must match DOCTYPE root "null".

Please advise. Any ideas, sample code, resources highly appreciated. Thanks in advance.
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
Build path?
or under
web-inf/lib
You have to put them in the WEB-INF/lib folder, or somewhere where Tomcat can find them (for example in Tomcat's lib folder). Then restart the server amd it should work.
0
gudii9Author Commented:
>>You have to put them in the WEB-INF/lib folder


just copy under WEB-INF/lib folder right.

After copying do you need to explicitly do below step???

 go to

projects(tab at the top)--->properties--->java build path--->libraries--->Add Libraries(not Add Externnal Jars since within same project  WEB-INF/lib )

If no when do we need to do that step??(only for when adding external jars??)

Please advise
0
girionisCommented:
You have to put it in the build path only if you want to include the libraries in the file you will build (usually the ear). But I think eclipse adds all the files in the WEB-INF/lib folder of the project to the .ear/.jar file automatically.
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

gudii9Author Commented:
>>.You have to put it in the build path only if you want to include the libraries in the file you will build (usually the ear).


If i want to run the same EAR on different laptop with diferent eclipse and different server like tomcat/jboss then that previous build path no longer valid right. How do i handle in that scenario. Please advise?
0
girionisCommented:
It does not matter if it's valid since the ear should contain everything under the WEB-INF folder, so no need for anything else.
0
gudii9Author Commented:
>>>You have to put it in the build path only if you want to include the libraries in the file you will build (usually the ear). But I think eclipse adds all the files in the WEB-INF/lib folder of the project to the .ear/.jar file automatically.





step1.

>>>put to build path

means


 go to

projects(tab at the top)--->properties--->java build path--->libraries--->Add Libraries(not Add Externnal Jars since within same project  WEB-INF/lib )
right???




step2.
>>adds all the files in the WEB-INF/lib


MEans


just copy under WEB-INF/lib folder right by going to physical folder location like

C:\Users\ganesha\eclipseJuno_workspace\ljn_servletsJsp\de.vogella.jsf.first\WebContent\WEB-INF\lib

right????

please advise

so once I do step1 and step2 and export code as EAR file from first laptop then i can go to second laptop with different eclipse, server i can export there same EAR. In the second laptop/machine i do not need to do step1, step2 since those jars already under the EAR ...WEB-INF/lib folder right.'

Please advise
0
girionisCommented:
For step 1, projects(tab at the top)--->properties--->java build path--->libraries--->Add Jars, although if you have the jar inside the WEB-INF/lib it should add it automatically.

For Step 2, no, it means that when you build your archive file eclipse automatically adds all the files under WEB-INF/ into the archive. You don't need to do anything else.

so once I do step1 and step2 and export code as EAR file from first laptop then i can go to second laptop with different eclipse, server i can export there same EAR.

No. It means that you can deploy the ear in the second laptop. If you want to build it you will have to do the same steps again.
0
gudii9Author Commented:
so JARs wont copied over,transported over in a EAR. So if i have to build in second laptop again i have to do same step( step 1, projects(tab at the top)--->properties--->java build path--->libraries--->Add Jars, although if you have the jar inside the WEB-INF/lib it should add it automatically.)

Is my understanding is correct? please advise
0
girionisCommented:
Jars will be copied into the EAR if you have them in WEB-INF/lib. You can copy the EAR to another laptop. But if you want to build the EAR in another laptop you will have to define the build path again (unless you export your preferences and everything).
0
gudii9Author Commented:
>>>unless you export your preferences and everything


How to export preferences and everything. Can you please laborate with suitable link.
0
girionisCommented:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftimpandexp.htm although by looking at it I am not sure if you can export your build path and everything. For this you will probably need the .project and .classpath files of your project.
0
gudii9Author Commented:
>>probably need the .project and .classpath files of your project.


How to import/get them as well. Please advise
0
girionisCommented:
Just copy them over and then when you create a new project just point/open these files.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.