5 Replies Latest reply on May 9, 2009 4:12 PM by Marc Baum

    Error in conversion Java Object to JavaScript

    Marc Baum Newbie

      Hi all,

      after a click on the following commandButton:

      <a4j:commandButton actionListener="#{PageManager.click}"
      value="Hoch" data="#{item}"
      image="/cms/icons/Up16.gif" />


      I get this error:

      javax.servlet.ServletException: Error in conversion Java Object to JavaScript
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
       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:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.faces.FacesException: Error in conversion Java Object to JavaScript
       at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:146)
       at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
       at org.ajax4jsf.renderkit.AJAXDataSerializer.asString(AJAXDataSerializer.java:40)
       at org.ajax4jsf.renderkit.AjaxRendererUtils.encodeAreas(AjaxRendererUtils.java:852)
       at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:126)
       at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
       at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
       at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
       at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       ... 18 more
      Caused by: java.lang.NoSuchMethodException: Property 'actualMaximum' has no getter method
       at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127)
       at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
       at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
       at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
       at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
       ... 33 more


      I can debug into the ActionListener Function so it that the error occurs somewhere on the way back.

      Has anybody a hint?

      Regards,
      Marc

        • 1. Re:  Error in conversion Java Object to JavaScript
          Marc Baum Newbie

          Does nobody have had this error?

          Any hints?

          Regards
          Marc

          • 2. Re:  Error in conversion Java Object to JavaScript
            Marc Baum Newbie

            The full Exception looks like this:

            java.lang.NoSuchMethodException: Property 'actualMaximum' has no getter method
            org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127)
            org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
            org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
            org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
            org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
            org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
            org.ajax4jsf.renderkit.AJAXDataSerializer.asString(AJAXDataSerializer.java:40)
            org.ajax4jsf.renderkit.AjaxRendererUtils.encodeAreas(AjaxRendererUtils.java:852)
            org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:126)
            org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
            org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
            javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
            com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
            com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
            org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
            org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
            com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
            com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
            com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
            javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
            org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
            org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
            org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
            org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)


            Hm, I have no attribute "actualMaximum" in my JSF.....

            • 3. Re:  Error in conversion Java Object to JavaScript
              Nick Belaevski Master

              Hello,

              Try removing data="#{item}" attribute.

              • 4. Re:  Error in conversion Java Object to JavaScript
                Marc Baum Newbie

                Hm, but how can I get in this case the reference to the data object? I use the commandButton within a rich:dataTable and would like to do an action on the record of every row.

                • 5. Re:  Error in conversion Java Object to JavaScript
                  Marc Baum Newbie

                  Okay, I got my mistake: The data object was not serializable. Maybe there should be a check and a better understanding exception?

                  Shall I fill in an jira issue?