3 Replies Latest reply on Aug 20, 2007 11:27 AM by Pete Muir

    exception

    Pierre Raoul Novice

      In a page with only a h:outputText and a h:form, as soon as I click on the submit button of the form, I get this exception


      12:23:22,468 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@13cf3bb) threw exception
      javax.el.PropertyNotWritableException: /home.xhtml @18,57 binding="#{bindingtest.testText()}": Illegal Syntax for Set Operation
      at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
      [...]
      Caused by: javax.el.PropertyNotWritableException: /home.xhtml @18,57 binding="#{bindingtest.testText()}": Illegal Syntax for Set Operation
      at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:245)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:250)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
      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)
      ... 37 more




      It must be obvious but i have no idea why.

      The application is generated with seam2/seam-gen from today cvs. The only changes are:
      - outputText and form in home.xhtml
      - class BindingTest.java

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       >
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <title>popsuite-binding</title>
       <link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
      </head>
      
      <body>
      
       <h:messages/>
      
       Test<br />
      
       <h:outputText binding="#{bindingtest.testText()}" />
      
       <h:form id="bindingtest">
      
       <h:commandButton id="valid"
       value="OK"
       action="#{bindingtest.valid}"/>
      
       </h:form>
      </body>
      </html>
      


      package org.popsuite.binding2;
      
      import static org.jboss.seam.ScopeType.APPLICATION;
      import static org.jboss.seam.annotations.Install.BUILT_IN;
      
      import javax.faces.component.UIComponent;
      import javax.faces.component.html.HtmlOutputText;
      
      import org.jboss.seam.annotations.Install;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.intercept.BypassInterceptors;
      
      @Scope(APPLICATION)
      @BypassInterceptors
      @Name("bindingtest")
      @Install(precedence = BUILT_IN)
      public class BindingTest
      {
       private String name;
       private String city;
      
       public UIComponent testText()
       {
       HtmlOutputText text = new HtmlOutputText();
       text.setValue("Very simple binding test");
       return text;
       }
      
       public String valid()
       {
       return null;
       }
      
       public String getName(){
       return this.name;
       }
      
       public void setName(String name){
       this.name = name;
       }
      
       public String getCity(){
       return this.city;
       }
      
       public void setCity(String city){
       this.city = city;
       }
      
      
      }
      




        • 1. Re: exception
          Shane Bryzak Master

          The exception message is quite descriptive - your binding needs to be a standard Javabean property, i.e. it requires both a get and set method. And also, remove the () from your expression you don't need them.

          • 2. Re: exception
            Pierre Raoul Novice

            OK.

            1/ So it isn't possible to use here the enhanced EL of Seam, something like:

             <h:outputText binding="#{bindingtest.testText('toto')}" />
            


             public HtmlOutputText testText(String text)
             {
             HtmlOutputText outputtext = new HtmlOutputText();
             outputtext.setValue(values.get(text));
             return outputtext ;
             }
            
            


            2/ I don't understand why a setter is needed as HtmlOutputText is a read only UIComponent.

            And everything works fine the first time the page is shown. The issue occures only when the submit button is clicked and the page is rerendered: facelet tries then to set the value of the HtmlOutputText instance.

            Why the renderer doesn't just reread the HtmlOutputText instance?

            The full exception stack is:

            INFO: Added Library from: jar:file:/C:/SERVER/jboss-4.2.0.CR2/server/default/deploy/popsuite-binding.ear/popsuite-binding.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
            10:24:09,018 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@46c14f) threw exception
            javax.el.PropertyNotWritableException: /home.xhtml @18,66 binding="#{bindingtest.getTestText('toto')}": Illegal Syntax for Set Operation
            at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:245)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:250)
            at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
            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)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
            at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
            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:228)
            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:216)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
            at java.lang.Thread.run(Thread.java:595)
            10:24:09,143 ERROR [ExceptionFilter] handling uncaught exception
            javax.servlet.ServletException: /home.xhtml @18,66 binding="#{bindingtest.getTestText('toto')}": Illegal Syntax for Set Operation
            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.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
            at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
            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:228)
            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:216)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
            at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.el.PropertyNotWritableException: /home.xhtml @18,66 binding="#{bindingtest.getTestText('toto')}": Illegal Syntax for Set Operation
            at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:245)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:250)
            at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
            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)
            ... 37 more
            10:24:09,143 ERROR [ExceptionFilter] exception root cause
            javax.el.PropertyNotWritableException: /home.xhtml @18,66 binding="#{bindingtest.getTestText('toto')}": Illegal Syntax for Set Operation
            at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:245)
            at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:250)
            at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
            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)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
            at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
            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:228)
            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:216)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
            at java.lang.Thread.run(Thread.java:595)


            • 3. Re: exception
              Pete Muir Master

              No, as a binding is a bi-directional valuebinding.