7 Replies Latest reply on Sep 15, 2008 11:32 AM by Nick Belaevski

    HTMLSuggestionBox    does not extend

    dreu zel Novice

      I've an odd problem using HTMLSuggestionBox

      I want to 'extend' some of the functionality but...
      this in the simplest possible form :



      class mySuggestionBox extends org.richfaces.component.html.HtmlSuggestionBox
      {
       mySuggestionBox()
       { super();
      
       } //initialize
      }
      


      durring the execution (working if not extended) it crashes during the processing of the suggestion action
      with following complaint:


      what am I doing wrong ???

      javax.faces.FacesException: Error on create new instance of the component with class tag.pro.component.option.UIOptions$3
       at org.ajax4jsf.application.ComponentsLoaderImpl.createComponent(ComponentsLoaderImpl.java:42)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:84)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:234)
       at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
       at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
       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:83)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       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:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.InstantiationException: tag.cycluspro.component.option.UIOptions$3
       at java.lang.Class.newInstance0(Unknown Source)
       at java.lang.Class.newInstance(Unknown Source)
       at org.ajax4jsf.application.ComponentsLoaderImpl.createComponent(ComponentsLoaderImpl.java:40)
       ... 54 more
      14:50:03,953 ERROR [ExceptionFilter] handling uncaught exception
      javax.servlet.ServletException: tag.cycluspro.component.option.UIOptions$3
       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:83)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       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:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.InstantiationException: tag.cycluspro.component.option.UIOptions$3
       at java.lang.Class.newInstance0(Unknown Source)
       at java.lang.Class.newInstance(Unknown Source)
       at org.ajax4jsf.application.ComponentsLoaderImpl.createComponent(ComponentsLoaderImpl.java:40)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:84)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:234)
       at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
       at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
       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
      14:50:03,968 ERROR [ExceptionFilter] exception root cause
      java.lang.InstantiationException: tag.cycluspro.component.option.UIOptions$3
       at java.lang.Class.newInstance0(Unknown Source)
       at java.lang.Class.newInstance(Unknown Source)
       at org.ajax4jsf.application.ComponentsLoaderImpl.createComponent(ComponentsLoaderImpl.java:40)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:84)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
       at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:234)
       at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
       at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
       at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
       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:83)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       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:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)
      
      


        • 1. Re: HTMLSuggestionBox    does not extend
          Nick Belaevski Master

          Check that inner class tag.cycluspro.component.option.UIOptions$3 is static & public.

          • 2. Re: HTMLSuggestionBox    does not extend
            dreu zel Novice

            Thanks it seems to work
            Only the Why escapes me especialy the static class part





            public static class mySuggestionBox extends org.richfaces.component.html.HtmlSuggestionBox
            {
            public mySuggestionBox()
             { super();
            
             } //initialize
            }


            • 3. Re: HTMLSuggestionBox    does not extend
              Nick Belaevski Master

              Sorrry, I didn't understand the question. Can you please rephrase it?

              • 4. Re: HTMLSuggestionBox    does not extend
                dreu zel Novice

                the public static characteristic
                does not allow for dynamicaly adding a parameter to the class that relates for example a suggestionAction to its caller or caller instance
                This is the main reason to extend the class.

                Is there a specific reason to limit to a static innerclass.

                • 5. Re: HTMLCommandButton    does not extend
                  dreu zel Novice

                  I seem to have a problem extending UIComponents
                  I asked the question for htmlSuggestion box
                  I did apply the answer to the letter and it worked,
                  but I'm surely still missing the point, since I have the same problem
                  for HtmlCommonadbutton


                   public static class myHtmlCommandButton extends javax.faces.component.html.HtmlCommandButton
                   {
                   public myHtmlCommandButton(Object Name)
                   { super();
                   obj=Name;
                   }
                   Object obj=null;
                   String styleDefault="button";
                   @Override
                   public void decode(FacesContext ctx)
                   { UIComponent parent=this.getParent();
                   while (parent!=null)
                   {if (parent instanceof UICustomComponent) {break;}
                   parent=parent.getParent();
                   }
                   if (parent !=null)
                   ((UICustomComponent) parent).InternalEventSimulator(ctx,this,((UICustomComponent) parent).param,"button", obj);
                   super.decode(ctx);
                   }
                   @Override
                   public Object getValue() {return obj;}
                  // public void setRefValue(Object val) {refVal=val;}
                  // public void setName(Object val) {name=val;}
                  }
                  




                  as I extend now using the class static marker


                  I do get the same problem as before


                  7:17:50,546 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@829a91) threw exception
                  javax.faces.FacesException: Error on create new instance of the component with class tag.pro.component.option.UICustomComponent$myHtmlCommandButton
                   at org.ajax4jsf.application.ComponentsLoaderImpl.createComponent(ComponentsLoaderImpl.java:42)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:84)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.TreeStructureNode.restore(TreeStructureNode.java:98)
                   at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:234)
                   at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:290)
                   at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
                   at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
                   at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
                   at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
                   at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
                   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:83)
                   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                  


                  • 6. Re: HTMLSuggestionBox    does not extend
                    Nick Belaevski Master

                    You should define public no-arg constructor.

                    • 7. Re: HTMLSuggestionBox    does not extend
                      Nick Belaevski Master

                       

                      "dreuzel" wrote:
                      the public static characteristic
                      does not allow for dynamicaly adding a parameter to the class that relates for example a suggestionAction to its caller or caller instance
                      This is the main reason to extend the class.

                      Is there a specific reason to limit to a static innerclass.


                      Yes, there is a specific reason: how does JSF know which instance of outer class to use when creating instance of inner class if it not static?