3 Replies Latest reply on Sep 26, 2008 11:05 AM by Aleksandr Dubovsky

    Suggestion as combobox throws exception

    rust Newbie

      Hello

      I have had suggestion field that have worked perfectly, then
      i have tried to use suggestion with combobox as shown on the livedemo page of exadel. So I have added
      <h:graphicImage id="suggestButton" value="/images/down.jpg" onclick="#{rich:component('suggestionBoxId')}.callSuggestion(true)"/>

      And now after onchange event I'm receiving the following exception

      java.lang.NullPointerException
      at org.apache.el.lang.FunctionMapperImpl$Function.writeExternal(FunctionMapperImpl.java:123)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
      at java.util.HashMap.writeObject(HashMap.java:1039)
      at sun.reflect.GeneratedMethodAccessor422.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)

      I'm using richfaces v3.2.1

      Thank you

        • 1. Re: Suggestion as combobox throws exception
          Aleksandr Dubovsky Newbie

          Hello Rustam,

          "callSuggestion" JS function is new feature of suggestionBox. This function was added in 3.2.2 version.

          • 2. Re: Suggestion as combobox throws exception
            rust Newbie

            Hello,


            I have changed version to 3.2.2 and I have received the following exception:


            javax.faces.FacesException: Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /view/hotlineSingle.xhtml][Class: javax.faces.component.html.HtmlPanelGroup,Id: contentPanel][Class: org.ajax4jsf.component.html.Include,Id: mainColumnContent][Class: javax.faces.component.html.HtmlForm,Id: mainForm][Class: org.richfaces.component.html.HtmlTabPanel,Id: tabPanel][Class: org.richfaces.component.html.HtmlTab,Id: erfassung][Class: javax.faces.component.html.HtmlPanelGrid,Id: gg]}
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:559)
            at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
            at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
            at org.richfaces.renderkit.TabRendererBase.encodeChildren(TabRendererBase.java:113)
            at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:543)
            at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
            at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
            at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:286)
            at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:281)
            at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
            at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:543)
            at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
            at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
            at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
            at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
            at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
            at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:124)
            at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
            at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
            at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:67)
            at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:115)
            at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
            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:239)
            at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
            at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
            at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
            at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
            at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
            at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
            at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
            at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
            at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
            at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
            at at.publicware.g3.security.web.filter.G3ExceptionTranslationFilter.doFilter(G3ExceptionTranslationFilter.java:33)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
            at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
            at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
            at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
            at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
            at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
            at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
            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:175)
            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:263)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.faces.FacesException: Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /view/hotlineSingle.xhtml][Class: javax.faces.component.html.HtmlPanelGroup,Id: contentPanel][Class: org.ajax4jsf.component.html.Include,Id: mainColumnContent][Class: javax.faces.component.html.HtmlForm,Id: mainForm][Class: org.richfaces.component.html.HtmlTabPanel,Id: tabPanel][Class: org.richfaces.component.html.HtmlTab,Id: erfassung][Class: javax.faces.component.html.HtmlPanelGrid,Id: gg][Class: javax.faces.component.html.HtmlPanelGroup,Id: j_id20]}
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:559)
            at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:515)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:221)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556)
            ... 68 more
            Caused by: javax.faces.FacesException: Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /view/hotlineSingle.xhtml][Class: javax.faces.component.html.HtmlPanelGroup,Id: contentPanel][Class: org.ajax4jsf.component.html.Include,Id: mainColumnContent][Class: javax.faces.component.html.HtmlForm,Id: mainForm][Class: org.richfaces.component.html.HtmlTabPanel,Id: tabPanel][Class: org.richfaces.component.html.HtmlTab,Id: erfassung][Class: javax.faces.component.html.HtmlPanelGrid,Id: gg][Class: javax.faces.component.html.HtmlPanelGroup,Id: j_id20][Class: javax.faces.component.html.HtmlGraphicImage,Id: suggestButton]}
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:559)
            at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:515)
            at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:492)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556)
            ... 72 more
            Caused by: javax.faces.FacesException: Could not get property onclick of component mainColumnContent:mainForm:suggestButton
            at javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:395)
            at javax.faces.component._ComponentAttributesMap.get(_ComponentAttributesMap.java:230)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderHTMLAttribute(HtmlRendererUtils.java:565)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderHTMLAttributes(HtmlRendererUtils.java:579)
            at org.apache.myfaces.shared_impl.renderkit.html.HtmlImageRendererBase.encodeEnd(HtmlImageRendererBase.java:78)
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556)
            ... 76 more
            Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.GeneratedMethodAccessor323.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at javax.faces.component._ComponentAttributesMap.getComponentProperty(_ComponentAttributesMap.java:390)
            ... 81 more
            Caused by: javax.el.ELException: /view/heTicket.xhtml @31,165 onclick="#{rich:component('suggestionBoxId')}.callSuggestion(true)": Function 'rich:component' not found
            at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
            at javax.faces.component.html.HtmlGraphicImage.getOnclick(HtmlGraphicImage.java:223)
            ... 85 more

            Rustam

            "adubovsky" wrote:
            Hello Rustam,

            "callSuggestion" JS function is new feature of suggestionBox. This function was added in 3.2.2 version.


            • 3. Re: Suggestion as combobox throws exception
              Aleksandr Dubovsky Newbie

              All work fine in live demo application and on our local environment.

              Please, give some details:

              - what server do you use
              - do you use facelets or jsp
              - give source code of problematic page if it is possible

              Also, try to use full id of suggestionBox instead of using rich:component function:

              onclick="$('FULL_ID').component.callSuggestion(true)"
              instead of
              onclick="#{rich:component('ID')}.callSuggestion(true)"