10 Replies Latest reply on Jul 16, 2009 10:11 PM by Atul Mogha

    rich:tabPanel binding attribute, does not accept org.richfac

    Atul Mogha Newbie

      Hi,
      I was trying to use the rich:tabPanel's binding attribute in my code, so that I'll be able to dynamically switch the tabs in my application, but when I provided a org.richfaces.component.html.HtmlTabPanel instance for binding, I got the following error:

      javax.faces.FacesException: javax.el.ELException: /acct/index.xhtml @34,127 binding="#{configReader.tabPanel}": java.lang.IllegalArgumentException: argument type mismatch
      at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:253)
      at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:394)
      at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:224)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:139)
      at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
      at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
      at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
      at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
      at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
      at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
      at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
      at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
      at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
      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:109)
      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:390)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      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:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      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:182)
      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(Thread.java:595)
      Caused by: javax.el.ELException: /acct/index.xhtml @34,127 binding="#{configReader.tabPanel}": java.lang.IllegalArgumentException: argument type mismatch
      at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:101)
      at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:250)
      ... 68 more
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
      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:585)
      at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
      at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
      at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:100)
      at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
      at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
      at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
      at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
      ... 69 more


      In the rich:abPanel documentation, the attribute accepts any EL expression that evaluates to javax.faces.component.UIComponent

      but when I searched for the HtmlTabPanel hierarchy the top most class in that hierarchy is javax.faces.component.UIComponent.

      What should I do to resolve this issue. Is there anything wrong in my approach or am I missing something??

        • 1. rich:tabPanel binding attribute, does not accept org.richfa
          Atul Mogha Newbie

          Can anyony help me in this.......my work is really stuck because of this problem.

          • 2. Re: rich:tabPanel binding attribute, does not accept org.ric
            Nick Belaevski Master

            Hi,

            Probably, you have two different UITabPanel classes in two different classloaders.

            • 3. Re: rich:tabPanel binding attribute, does not accept org.ric
              Atul Mogha Newbie

              Hi,

              Can you please tell me how to resolve this issue. how to check whether I am using more than one UITabPanel classes in two different classloaders.

              "nbelaevski" wrote:
              Hi,

              Probably, you have two different UITabPanel classes in two different classloaders.


              • 4. Re: rich:tabPanel binding attribute, does not accept org.ric
                Ilya Shaikovsky Master

                if you deploing your application as EAR - you should have impl and ui jars in webapp and api jar in EAR libraries.

                • 5. Re: rich:tabPanel binding attribute, does not accept org.ric
                  Atul Mogha Newbie

                   

                  "ilya_shaikovsky" wrote:
                  if you deploing your application as EAR - you should have impl and ui jars in webapp and api jar in EAR libraries.


                  Hi,

                  I changed the EAR library to only have rich api jar and the webapp library to have the ui and impl jars but now I got the foloowing error after deployment:


                  18:04:51,843 ERROR [[/Calonex2]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                  java.lang.RuntimeException: Could not create Component: configReader
                  at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1202)
                  at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1118)
                  at org.jboss.seam.init.Initialization.init(Initialization.java:733)
                  at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
                  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
                  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
                  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
                  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                  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:585)
                  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
                  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:585)
                  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
                  at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
                  at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
                  at org.jboss.web.WebModule.startModule(WebModule.java:83)
                  at org.jboss.web.WebModule.startService(WebModule.java:61)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.GeneratedMethodAccessor1580.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy44.start(Unknown Source)
                  at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
                  at sun.reflect.GeneratedMethodAccessor2927.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                  at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
                  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                  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:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy45.start(Unknown Source)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                  at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                  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:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy9.deploy(Unknown Source)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)

                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                  Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlTabPanel
                  at java.lang.Class.getDeclaredMethods0(Native Method)
                  at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
                  at java.lang.Class.privateGetPublicMethods(Class.java:2519)
                  at java.lang.Class.getMethods(Class.java:1406)
                  at org.jboss.seam.Component.hasAnnotation(Component.java:1158)
                  at org.jboss.seam.Component.(Component.java:218)
                  at org.jboss.seam.Component.(Component.java:205)
                  at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186)
                  ... 92 more


                  • 6. Re: rich:tabPanel binding attribute, does not accept org.ric
                    Nick Belaevski Master

                    UI components should not be bound to EJB components. Use UIComponent class as field type if it's absolutely necessary.

                    • 7. Re: rich:tabPanel binding attribute, does not accept org.ric
                      Atul Mogha Newbie

                       

                      "nbelaevski" wrote:
                      UI components should not be bound to EJB components. Use UIComponent class as field type if it's absolutely necessary.


                      Then how should I implement dynamic switching on the rich:tabs.
                      The thing I want to achieve is as follows:

                      There is a link in one tab, by clicking on that link the user should be directed to the corresponding tab.

                      To achieve this I tried to use the binding attribute on the rich:tabPanel. And I bound this variable to the HtmlTabPanel variable defined in my bean class.

                      But then I got the exception for illigalArgumentException.

                      Then I changed the EAR libraries to only include the rich api jars, and then I got the above exception upon deployment. I am now really confused, how to achieve this.

                      Can you provide any working example.

                      • 8. Re: rich:tabPanel binding attribute, does not accept org.ric
                        Ilya Shaikovsky Master

                        1) I'm not sure why UI class not works for you.

                        2) I didn't understand at all why you need binding. You could use just selectedTab attribute and manage it by link action.

                        • 9. Re: rich:tabPanel binding attribute, does not accept org.ric
                          Alexander Smirnov Master

                          Seam framework could provoke developers to make bad architecture design.
                          You mixed business logic and view presentation in the EJB module.
                          As it was mentioned before, nothing JSF but UIComponent class should be used in EJB module.
                          The better idea to create bean in your web application that manipulates tab component and keep EJB for business logic only.
                          Take a look for the "Presentation Model" pattern http://martinfowler.com/eaaDev/PresentationModel.html

                          • 10. Re: rich:tabPanel binding attribute, does not accept org.ric
                            Atul Mogha Newbie

                            So is there any way other than using java. Can we do it through javaScript. If I can do it through JavaScript than it will great.