java - <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> -


when add following line in faces-config.xml file:

" <application><view-handler>com.sun.facelets.faceletviewhandler</view-handler></application> " 

eclipse says:

" view-handler references "com.sun.facelets.faceletviewhandler" not implement interface javax.faces.application.viewhandler  configure problem severity preference 'invalid view handler' " 

however, added libraries in "lib" of "web-inf" of jsf project. when deploy ear , jsf projects, deploy correctly, execution of jsf page, error:

" javax.servlet.servletexception: /adduser.xhtml @9,9 <h:head> tag library supports namespace: http://java.sun.com/jsf/html, no tag defined name: head javax.faces.webapp.facesservlet.service(facesservlet.java:606) " 

and in console, have:

14:05:49,420 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/primefaces-3.5.jar/meta-inf/primefaces-p.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/primefaces-3.5.jar/meta-inf/primefaces-p.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/primefaces-3.5.jar/meta-inf/primefaces-p.taglib.xml@5,17] ... 14:05:49,450 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-fn.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-fn.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-fn.taglib.xml@47,31] ... 14:05:49,469 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-core.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-core.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/jstl-core.taglib.xml@47,31] ... 14:05:49,479 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/ui.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/ui.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/ui.taglib.xml@47,31] ... 14:05:49,479 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/facelets_jsf_core.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/facelets_jsf_core.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/facelets_jsf_core.taglib.xml@47,31] ... 14:05:49,479 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/composite.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/composite.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/composite.taglib.xml@47,29] ... 14:05:49,489 grave [facelets.compiler] error loading library: vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/html_basic.taglib.xml: java.io.ioexception: error parsing [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/html_basic.taglib.xml]:  ... caused by: org.xml.sax.saxexception: error handling [vfs:/c:/users/citech/desktop/testjsf/jsf/.metadata/.plugins/org.jboss.ide.eclipse.as.core/jboss_6.x_runtime_server1368781328313/deploy/helloworldjsf.war/web-inf/lib/jsf-impl-2.1.6.jar/com/sun/faces/metadata/taglib/html_basic.taglib.xml@47,31] ... 14:05:49,499 grave [facelets.viewhandler] error rendering view[/adduser.xhtml]: com.sun.facelets.tag.tagexception: /adduser.xhtml @9,9 <h:head> tag library supports namespace: http://java.sun.com/jsf/html, no tag defined name: head ... 14:05:49,499 error [org.apache.catalina.core.containerbase.[jboss.web].[localhost].[/helloworldjsf].[faces servlet]] "servlet.service()" pour la servlet faces servlet généré une exception: com.sun.facelets.tag.tagexception: /adduser.xhtml @9,9 <h:head> tag library supports namespace: http://java.sun.com/jsf/html, no tag defined name: head ... 

but when remove line in faces_config.xml: , redeploy projects, deployed , jsf page opens. when validate form records in database, returns me same page , in console, there following error:

"  info  [stdout] userbeanctrl.adduser(): erreur d'initialisation du contexte jndi<javax.naming.namingexception: not dereference object [root exception java.lang.runtimeexception: can not find interface declared proxy in our cl + org.jboss.web.tomcat.service.webctxloader$encloader@526f437d]> " 

i not understand happening.

faces-config.xml

    xmlns="http://java.sun.com/xml/ns/javaee"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"     version="2.0">  <managed-bean>   <managed-bean-name>userbeanvue</managed-bean-name>   <managed-bean-class>net.viralpatel.jsf.helloworld.userbeanvue</managed-bean-class>   <managed-bean-scope>session</managed-bean-scope>  </managed-bean>  <managed-bean>   <managed-bean-name>userbeanctrl</managed-bean-name>   <managed-bean-class>net.viralpatel.jsf.helloworld.userbeanctrl</managed-bean-class>   <managed-bean-scope>session</managed-bean-scope>  </managed-bean>  <navigation-rule>   <display-name>adduser</display-name>   <from-view-id>/adduser.xhtml</from-view-id>   <navigation-case>    <from-outcome>success</from-outcome>    <to-view-id>/listuser.xhtml</to-view-id>   </navigation-case>  </navigation-rule>  <application>   <view-handler>com.sun.facelets.faceletviewhandler</view-handler>  </application> </faces-config> 

web.xml

<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0">   <display-name>helloworldjsf</display-name>   <context-param>     <param-name>primefaces.theme</param-name>     <param-value>bluesky</param-value>   </context-param>   <context-param>     <param-name>facelets.refresh_period</param-name>     <param-value>2</param-value>   </context-param>   <context-param>     <param-name>javax.faces.default_suffix</param-name>     <param-value>.xhtml</param-value>   </context-param>   <context-param>     <description>state saving method: 'client' or 'server' (=default). see jsf specification 2.5.2</description>     <param-name>javax.faces.state_saving_method</param-name>     <param-value>client</param-value>   </context-param>   <context-param>     <param-name>javax.servlet.jsp.jstl.fmt.localizationcontext</param-name>     <param-value>resources.application</param-value>   </context-param>   <listener>     <listener-class>com.sun.faces.config.configurelistener</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>   <servlet-mapping>     <servlet-name>faces servlet</servlet-name>     <url-pattern>*.jsf</url-pattern>   </servlet-mapping> </web-app> 

it you're mixing jsf 1.x, facelets 1.x , jsf 2.x. you've there jsf 2.0 compatible faces-config.xml root declaration, you're still declaring managed beans , navigation cases legacy jsf 1.x way (those entries not needed anymore in jsf 2.x @mangedbean annotation , implicit navigation feature). perhaps reading wrong books/tutorials/resources while attempting learn jsf 2.x.

also, viewhandler implementation mentioned there facelets 1.x necessary when you're still using legacy jsf 1.x. however, since jsf 2.x, facelets 2.x bundled in jsf api/implementation jars , has become default view technology, there no need have separate facelets jar file nor manually register view handler in faces-config.xml.

the tag error on <h:head> confirms you're using jsf 1.x jars during runtime instead of jsf 2.x <h:head> introduced in jsf 2.x , absent in jsf 1.x.

get rid of jsf 1.x , facelets 1.x related jars , make sure you've downloaded , installed jsf 2.x ones (or don't download jboss 6x ships jsf 2.x bundled, having empty /web-inf/lib should sufficient in order jsf 2.x run). throw away jsf 1.x books/tutorials/resources , head jsf 2.x ones. our jsf wiki page starting point.

as xml configuration files, ultimately, should end empty faces-config.xml , only following entry in web.xml:

<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>*.xhtml</url-pattern> </servlet-mapping> 

add if necessary primefaces theme back, if default of "aristo" isn't want.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -