8 Replies Latest reply on May 13, 2009 9:03 AM by Maxim Kuzmik

    not instance of org.richfaces.component.UIPanelMenu

    Maxim Kuzmik Newbie

      Hello, All. I have the next page:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:s="http://jboss.com/products/seam/taglib">
      
       <h:form id="form">
       <h:panelGrid columns="1" width="100%">
       <rich:panelMenu binding="#{mainMenu.menu}"></rich:panelMenu>
       </h:panelGrid>
       </h:form>
      </ui:composition>
      


      and class:
      /**
       * <p>Titre : ADPclearing java packages</p>
       * <p>Description : Java packages for ADPclearing web based products</p>
       * <p>Copyright : Copyright (c) 2003-2007</p>
       */
      package com.adpclr.ejb.ui;
      
      import javax.faces.component.UIComponent;
      
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.security.Identity;
      import org.richfaces.component.html.HtmlPanelMenu;
      import org.richfaces.component.html.HtmlPanelMenuGroup;
      
      /**
       * @author Maxim Kuzmik
       * Date of Create: 06.05.2009
       * @version 1.0
       *
       */
      
      @Name("mainMenu")
      public class MainMenu{
       @In
       Identity identity;
      
       private HtmlPanelMenu menu;
      
       public void setMenu(HtmlPanelMenu menu){
       this.menu = menu;
       }
      
       public HtmlPanelMenu getMenu(){
       menu = new HtmlPanelMenu();
       menu.setId("pnlMenu");
       menu.setRendered(true);
       menu.setMode("ajax");
       menu.setIconCollapsedTopGroup("triangle");
       menu.setIconExpandedTopGroup("triangleDown");
       this.addMenu((byte)0, menu);
       return menu;
       }
      
       private void addMenu(byte owner,
       UIComponent ownerComponent){
       HtmlPanelMenuGroup grpPanel = new HtmlPanelMenuGroup();
       grpPanel.setLabel("Test Label");
       grpPanel.setName("Test Name");
       grpPanel.setId("Test_Id");
       ownerComponent.getChildren().add(grpPanel);
       }
      }
      
      


      But when i try to display thisa pgae, I have got the next errror:
      Component form:j_id3 not instance of org.richfaces.component.UIPanelMenu
      
      java.lang.IllegalArgumentException: Component form:j_id3 not instance of org.richfaces.component.UIPanelMenu
       at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:93)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:232)
       at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180)
       at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
       at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
       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)
       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.IdentityFilter.doFilter(IdentityFilter.java:40)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
       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:178)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
       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:235)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       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:158)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      


      But then I do it not dinamicly all os fine =(

        • 1. Re: not instance of org.richfaces.component.UIPanelMenu
          Ilya Shaikovsky Master

          Are you deploying your app as EAR? then you should place richfaces-api to ear libs and impl with ui in war libs.

          • 2. Re: not instance of org.richfaces.component.UIPanelMenu
            Maxim Kuzmik Newbie

            yep, as ear. In my ear i have all three libs. and in war too.

            • 3. Re: not instance of org.richfaces.component.UIPanelMenu
              Ilya Shaikovsky Master

              so classloading issue appears. place them as described above.

              • 4. Re: not instance of org.richfaces.component.UIPanelMenu
                Maxim Kuzmik Newbie

                Hm, after that it cannot find org.richfaces.component.html.HtmlPanelMenu in ejb module =(

                • 5. Re: not instance of org.richfaces.component.UIPanelMenu
                  Maxim Kuzmik Newbie

                   

                  14:51:41,954 ERROR [[/eServicesNew]] Exception sending context initialized event to listener instance of class org.jbos
                  .seam.servlet.SeamListener
                  java.lang.RuntimeException: Could not create Component: mainMenu
                   at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1178)
                   at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1094)
                   at org.jboss.seam.init.Initialization.init(Initialization.java:728)
                   at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:35)
                   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
                   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
                   at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                   at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                   at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                   at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                   at java.lang.reflect.Method.invoke(Method.java:597)
                   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                   at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                   at $Proxy36.start(Unknown Source)
                   at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                   at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                   at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContex
                  Action.java:62)
                   at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java
                  71)
                   at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:
                  1)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                   at org.jboss.system.ServiceController.start(ServiceController.java:460)
                   at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
                   at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
                   at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeploye
                  .java:62)
                   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                   at org.jboss.Main.boot(Main.java:209)
                   at org.jboss.Main$1.run(Main.java:547)
                   at java.lang.Thread.run(Thread.java:619)
                  Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlPanelMenu
                  


                  • 6. Re: not instance of org.richfaces.component.UIPanelMenu
                    Alfred Thomas Newbie

                    I am having the same problems with the SEAM generate project where the HTML* classes is defined in richfaces-ui and is included in the WAR and not in the EAR. Seam Actions is in the EJB and won't see the HTML* classes.

                    I also moved all 3 Richfaces jars to EJB to get around this, but the now the IDE complains about me casting ActionEvent.getComponent() to HtmlAjaxCommandButton. The IDE wrans that javax.faces.component.UIComponent cannot be cast to HtmlAjaxCommandButton, but the code does compile.