3 Replies Latest reply on May 24, 2007 8:27 AM by Gavin King

    s:validateAll throwing

    Leo Newbie

      Guys,

      I've just migrate to Jboss 4.2 and seam from cvs.

      I am using netbeans facelets com webui.jar for some components, like the ui:addremove. Well, it was working fine before the migration. Now, when I select some items from left to right list box and submit an addremove inside a s:validateAll I am getting this error:

      10:51:29,609 ERROR [ExceptionFilter] uncaught exception
      javax.servlet.ServletException: component has no value attribute: workspace
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.HttpAuthFilter.processBasicAuth(HttpAuthFilter.java:121)
       at org.jboss.seam.web.HttpAuthFilter.doFilter(HttpAuthFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:59)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:47)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:81)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:264)
       at org.jboss.seam.web.AbstractAjax4jsfFilter.doFilter(AbstractAjax4jsfFilter.java:35)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:64)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:55)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:126)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:248)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.RuntimeException: component has no value attribute: workspace
       at org.jboss.seam.ui.ModelValidator.validate(ModelValidator.java:23)
       at javax.faces.component.UIInput.validateValue(UIInput.java:1013)
       at javax.faces.component.UIInput.validate(UIInput.java:867)
       at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
       at javax.faces.component.UIInput.processValidators(UIInput.java:666)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
       at javax.faces.component.UIForm.processValidators(UIForm.java:229)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
       at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$201(AjaxViewRoot.java:53)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:302)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:54)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:194)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processValidators(AjaxViewRoot.java:315)
       at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
       ... 41 more
      
      


      I realize this error is raised from here:


      package org.jboss.seam.ui;
      
      import javax.el.ValueExpression;
      import javax.faces.application.FacesMessage;
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.Validator;
      import javax.faces.validator.ValidatorException;
      
      import org.hibernate.validator.InvalidValue;
      import org.jboss.seam.core.Expressions;
      import org.jboss.seam.core.FacesMessages;
      
      public class ModelValidator implements Validator
      {
      
       public void validate(FacesContext context, UIComponent component, Object value)
       throws ValidatorException
       {
       ValueExpression valueBinding = component.getValueExpression("value");
       if (valueBinding==null)
       {
       throw new RuntimeException("component has no value attribute: " + component.getId());
       }
      ...
      


      Do you guys have any ideia what I am doing wrong ?

      My bests
      Leo




        • 1. Re: s:validateAll throwing component has no value attribute:
          Leo Newbie

          Sorry,

          I forget my config files infos and other stuffs: (I've included a complete list of used jar files inside jsf-libs and WEB-INF/lib/ directories)

          my ui:addremove declaration on xhtml

          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:ui2="http://www.sun.com/web/ui"
           xmlns:a="https://ajax4jsf.dev.java.net/ajax"
           template="layout/template.xhtml">
          
          ...
          <s:validateAll>
          
          ....
          
          
          
           <s:decorate id="workspaceDecoration">
           <ui2:addRemove
           availableItemsLabel="#{messages['labels.configEdit.availableWorkspaces']}"
           id="workspace" items="#{workspaceList.allWorkspacesOption}"
           selected="#{configHome.instance.workspacesAvailableForAll}"
           selectedItemsLabel="#{messages['labels.configEdit.selectedWorkspaces']}"
           converter="workspaceConverter" />
           </s:decorate>
          ...
          
          </s:validateAll>
          
          


          My workspaceConverter
          public class WorkspaceConverter implements Converter {
          
           /** Creates a new instance */
           public WorkspaceConverter() {
           }
          
           public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String string) throws ConverterException {
           if (string == null || string.equals("")) {
           return null;
           }
           Workspace vo = ((EntityManager) Component.getInstance("entityManager")).find(Workspace.class, Integer.valueOf(string));
           return vo;
           }
          
           public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) throws ConverterException {
           if (object == null || object.equals("")) {
           return (String) object;
           }
           return String.valueOf(((Workspace) object).getId());
           }
          


          My Components.xml:
          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
           xmlns:core="http://jboss.com/products/seam/core"
           xmlns:web="http://jboss.com/products/seam/web"
           xmlns:drools="http://jboss.com/products/seam/drools"
           xmlns:security="http://jboss.com/products/seam/security"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:mail="http://jboss.com/products/seam/mail"
           xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.3.xsd
           http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.3.xsd
           http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.3.xsd
           http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.3.xsd
           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.3.xsd">
          
           <core:init debug="true" jndi-pattern="@jndiPattern@" />
          
           <core:manager concurrent-request-timeout="500"
           conversation-timeout="120000" conversation-id-parameter="cid"
           conversation-is-long-running-parameter="clr" />
          
           <core:managed-persistence-context name="entityManager"
           auto-create="true"
           persistence-unit-jndi-name="java:/etaskEntityManagerFactory" />
          
           <core:ejb installed="@embeddedEjb@" />
          
           <drools:rule-base name="securityRules">
           <drools:rule-files>
           <value>/security.drl</value>
           </drools:rule-files>
           </drools:rule-base>
          
           <security:identity
           authenticate-method="#{authenticator.authenticate}"
           security-rules="#{securityRules}" remember-me="true" />
          
           <event type="org.jboss.seam.notLoggedIn">
           <action expression="#{redirect.captureCurrentView}" />
           </event>
           <event type="org.jboss.seam.postAuthenticate">
           <action expression="#{redirect.returnToCapturedView}" />
           </event>
          
           <web:multipart-filter create-temp-files="true"
           max-request-size="100000000" url-pattern="*.seam" />
          
           <mail:mail-session session-jndi-name="java:/Mail" />
          
           <mail:mail-session host="mail.bittecnologia.com" />
          
           <core:resource-bundle>
           <core:bundle-names>
           <value>messages</value>
           </core:bundle-names>
           </core:resource-bundle>
          
           <core:dispatcher />
          
           <core:transactionListener/>
          
           <component name="org.jboss.seam.ui.entityConverter">
           <property name="entityManager">#{em}</property>
           </component>
          
          </components>
          



          my web.xml:
          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
          
           <description>workflow for everything</description>
           <display-name>eTask</display-name>
          
           <!-- Ajax4jsf (must come first!) -->
          
           <filter>
           <filter-name>ajax4jsf</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>ajax4jsf</filter-name>
           <url-pattern>*.seam</url-pattern>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
           </filter-mapping>
          
           <context-param>
           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>
           org.jboss.seam.ui.facelet.SeamFaceletViewHandler
           </param-value>
           </context-param>
          
          
           <!-- Seam -->
          
           <listener>
           <listener-class>
           org.jboss.seam.servlet.SeamListener
           </listener-class>
           </listener>
          
          
           <filter>
           <filter-name>Seam Filter</filter-name>
           <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>Seam Filter</filter-name>
           <url-pattern>/*</url-pattern>
           </filter-mapping>
          
           <servlet>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <servlet-class>
           org.jboss.seam.servlet.ResourceServlet
           </servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
          
           <!-- Facelets development mode (disable in production) -->
          
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <context-param>
           <param-name>facelets.LIBRARIES</param-name>
           <param-value>
           /WEB-INF/creator.taglib.xml;/WEB-INF/bit.taglib.xml
           </param-value>
           </context-param>
          
           <!-- JSF -->
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>server</param-value>
           </context-param>
          
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>
          
           <servlet>
           <servlet-name>ThemeServlet</servlet-name>
           <servlet-class>
           com.sun.rave.web.ui.theme.ThemeServlet
           </servlet-class>
           </servlet>
          
          
           <servlet-mapping>
           <servlet-name>ThemeServlet</servlet-name>
           <url-pattern>/etask/theme/*</url-pattern>
           </servlet-mapping>
          
           <servlet-mapping>
           <servlet-name>ThemeServlet</servlet-name>
           <url-pattern>/theme/*</url-pattern>
           </servlet-mapping>
          
           <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>*.seam</url-pattern>
           </servlet-mapping>
          
           <session-config>
           <session-timeout>120</session-timeout>
           </session-config>
           <security-constraint>
           <display-name>Restrict raw XHTML Documents</display-name>
           <web-resource-collection>
           <web-resource-name>XHTML</web-resource-name>
           <url-pattern>*.xhtml</url-pattern>
           </web-resource-collection>
           <auth-constraint>
           <role-name>NONE</role-name>
           </auth-constraint>
           </security-constraint>
          
          </web-app>
          



          And in my \jboss-4.2.0.GA\server\default\deploy\jboss-web.deployer\jsf-libs directory I have those libs
          20/03/2007 21:28 223.555 dataprovider.jar
          20/03/2007 21:28 201.917 defaulttheme.jar
          09/05/2007 23:04 395.403 drools-compiler-4.0.0.MR2.jar
          09/05/2007 23:04 901.631 drools-core-4.0.0.MR2.jar
          17/04/2007 10:23 45.018 jboss-el-api.jar
          23/04/2007 17:37 133.867 jboss-el.jar
          11/05/2007 14:44 8.210 jboss-faces.jar
          11/05/2007 14:44 326.486 jsf-api.jar
          11/05/2007 14:44 1.217.307 jsf-impl.jar
          19/05/2007 23:40 4.103.361 webui.jar
          


          and in my WEB-INF/lib
          21/05/2007 11:16 1.227.567 ajax4jsf-1.1.1-SNAPSHOT.jar
          21/05/2007 11:16 177.386 commons-beanutils-1.7.0.jar
          21/05/2007 11:16 46.725 commons-codec-1.3.jar
          21/05/2007 11:16 559.366 commons-collections-3.1.jar
          21/05/2007 11:16 168.446 commons-digester-1.6.jar
          21/05/2007 11:16 112.341 commons-el-1.0.jar
          21/05/2007 11:16 207.723 commons-lang-2.1.jar
          22/05/2007 10:49 11.723 jboss-seam-debug.jar
          22/05/2007 10:49 55.306 jboss-seam-ioc.jar
          22/05/2007 10:49 24.348 jboss-seam-mail.jar
          22/05/2007 10:49 75.683 jboss-seam-pdf.jar
          22/05/2007 10:49 93.327 jboss-seam-remoting.jar
          22/05/2007 10:49 124.648 jboss-seam-ui.jar
          21/05/2007 11:39 287.090 jsf-facelets.jar
          21/05/2007 11:16 124.487 oscache-2.3.2.jar
          19/05/2007 22:46 898.900 richfaces-3.0.1-SNAPSHOT.jar
          


          My application.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <application 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/application_5.xsd"
           version="5">
          
           <display-name>etask</display-name>
          
           <module>
           <web>
           <web-uri>etask.war</web-uri>
           <context-root>/etask</context-root>
           </web>
           </module>
          
           <module>
           <ejb>etask.jar</ejb>
           </module>
          
           <!-- Seam and EL -->
           <module>
           <java>jboss-seam.jar</java>
           </module>
          
           <module>
           <java>drools-compiler-4.0.0.MR2.jar</java>
           </module>
          
           <module>
           <java>drools-core-4.0.0.MR2.jar</java>
           </module>
          
           <module>
           <java>mvel14-1.2beta16.jar</java>
           </module>
          
           <module>
           <java>janino-2.5.6.jar</java>
           </module>
          
           <module>
           <java>antlr-3.0b7.jar</java>
           </module>
          
           <module>
           <java>jboss-cache-jdk50.jar</java>
           </module>
           <module>
           <java>jboss-aop-jdk50.jar</java>
           </module>
          
           <module>
           <java>jgroups.jar</java>
           </module>
          
           <module>
           <java>jboss-el.jar</java>
           </module>
          
          </application>
          


          • 2. Re: s:validateAll throwing component has no value attribute
            Leo Newbie

            I've just got out on this.

            The solution was replace all netbeans stuffs (ui:image, ui:addremove, ...) by trinidad components :(

            I got the examples from trinidad on jboss-seam-cvs/trinidad.

            TIP: to replace cascating style sheet from trinidad core skins, just put our style class somewhere before trinidad/adf .css declaration...

            rgds
            Leo

            • 3. Re: s:validateAll throwing
              Gavin King Master

              s:validate(All) can only work for JSF controls which have an attribute named "value". (It is meant to be used with EditableValueHolders.) I'm not sure what ui2:addRemove is, but you seem to be missing a value attribute...