users@woodstock.java.net

Re: JSF1004 error on deployment; ClassCastException

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 22 Mar 2007 16:18:30 -0700

Hi Tim,

JSF things ValueBindingFilterCriteria is defined as a UIComponent.  I believe it gets this information from the faces-config.xml file(s).  I don't know if the faces-config.xml file supplied with Woodstock is wrong, if your environment somehow is wrong, or if JSF has a bug.  You can probably get around this by turning off verification, or you may want to try upgrading to the newest version of JSF (there have been fixes in this area recently... not sure if this is addressed or not).

You might want to join the ##jsf IRC channel where some of the JSF RI developers spend a lot of time... you'll get very fast response time to your questions.

Good luck!

Ken Paulsen
ken.paulsen@sun.com
https://jsftemplating.dev.java.net

Romanowski, Tim wrote:

I’m trying to add Woodstock to my webapp, but it fails on startup.  I’m using Facelets, but from the blog I found at [1] and the example war on the project’s website, I think I’ve covered most of the big things.  Does anyone have a suggestion on how to resolve this error on deployment?  I’m using Glassfish V2 B37, compiling with JDK 1.5.0_11-b03, and am using SUN RI 1.2_03-b9-FCS along with Ajax4JSF, Facelets 1.1.12, and Tomahawk 1.1.5 nightlies.

 

Here’s a chunk of the server output:

 

Initializing Sun's JavaServer Faces implementation (1.2_03-b09-FCS) for context '/Zadig'

JSF1004: Cannot instantiate component of type com.sun.webui.jsf.faces.ValueBindingFilterCriteria

WebModule[/Zadig]com.sun.webui.jsf.faces.ValueBindingFilterCriteria

javax.faces.FacesException: java.lang.ClassCastException: com.sun.webui.jsf.faces.ValueBindingFilterCriteria cannot be cast to javax.faces.component.UIComponent

        at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:568)

        at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1378)

        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:451)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4468)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5120)

        at com.sun.enterprise.web.WebModule.start(WebModule.java:304)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:944)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:671)

        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1574)

        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1217)

 

 

What I’ve done:

1) Added the servlet/servlet mapping to web.xml

  1. <servlet>  
  2.     <servlet-name>ThemeServlet</servlet-name>  
  3.     <servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>  
  4.     <load-on-startup>2</load-on-startup>  
  5. </servlet>  
  6. <servlet-mapping>  
  7.     <servlet-name>ThemeServlet</servlet-name>  
  8.     <url-pattern>/theme/*</url-pattern>  
  9. </servlet-mapping>  

2) Copied the taglib (Woodstock.taglib.xml) linked off of [1], and added that as a param-value to my facelets.LIBRARIES parameter.

 

3) Added  the following context parameter:

 <context-param>

        <param-name>com.sun.webui.jsf.DEFAULT_THEME</param-name>

        <param-value>suntheme</param-value>

    </context-param>

 

4) Added the dependencies for Woodstock listed at [1] into my webapp by copying them from the example.war (also downloaded from the Woodstock project’s website).

 

5) Tried both (on different tests) implementations of the Woodstock primary jarfile. 

 

6) Included the webuijsf namespace as well as the webuijsf:head tag into my template file just to test that Woodstock will let me launch my app. I did not add any other Woodstock components!

 

Any suggestions?

 

Tim

 

[1] http://blogs.steeplesoft.com/2007/02/26/using-the-woodstock-sortable-table/#more-49