14 Replies Latest reply on Jul 9, 2010 10:28 AM by Jinping Zheng

    java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect

    Wang Ruifeng Newbie

      Why I get java.lang.NoClassDefFoundError:org/richfaces/component/html/HtmlInplaceSelect error,when I run my page?


      Here is my code:


      <a4j:outputPanel id="selectListPanel">
          <rich:inplaceSelect id="categoryRoot" defaultLabel="Please Select" valueChangeListener="#{categoryActionBean.createCategoryList}">                          
              <f:selectItems value="#{categoryOptions}"/>
              <a4j:support event="onviewactivated" reRender="selectListPanel"/>
          </rich:inplaceSelect>
      </a4j:outputPanel>



      When I select the inplaceSelect,it will call createCategoryList method.
      This method code is here:


          public void createCategoryList2(ValueChangeEvent ve) {
              FacesContext context = FacesContext.getCurrentInstance();
              UIViewRoot viewRoot = context.getViewRoot();
              UIComponent selectListPanel = findComponentById(viewRoot, "selectListPanel");      
              HtmlInplaceSelect inplaceSelect =  new HtmlInplaceSelect();
              inplaceSelect.setId("category" + inputIndex++);
              inplaceSelect.setRendered(true);
              selectListPanel.getChildren().add(inplaceSelect);
          }



      Here is the error report:


      22:59:10,765 ERROR [AjaxViewRoot] Error processing faces event for the component CategoryForm:categoryRoot
      javax.faces.event.AbortProcessingException: /categoryActionBean.xhtml @20,141 valueChangeListener="#{categoryActionBean.createCategoryList}": javax.ejb.EJBTransactionRolledbackException: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlInplaceSelect
              at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:93)
              at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:134)
              at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:294)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
              at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              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:38)
              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: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.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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
              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.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(Thread.java:619)
      Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlInplaceSelect
              at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
              at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
              at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
              at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
              at $Proxy355.createCategoryList(Unknown Source)
              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.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
              at org.javassist.tmp.java.lang.Object_$$_javassist_1.createCategoryList(Object_$$_javassist_1.java)
              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.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
              at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              at org.jboss.seam.el.OptionalParameterMethodExpression.invoke(OptionalParameterMethodExpression.java:39)
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:91)
              ... 51 more
      Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlInplaceSelect
              at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:174)
              at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
              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.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
              at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
              ... 92 more
      Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlInplaceSelect
              at cn.edu.swufe.sb.CategoryActionBean.createCategoryList(CategoryActionBean.java:91)
              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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
              at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
              ... 120 more



        • 1. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
          Daniel Roth Apprentice

          Since this is not Seam related, ask at the RichFaces forum.

          • 3. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
            Wang Ruifeng Newbie

            I think this is a bug of seam.
            When I put the richfaces-ui.jar to project.ear/lib.The class can be found.But I got another error.


            java.lang.IllegalArgumentException: Component CategoryForm:category0 not instance of org.richfaces.component.UIInplaceSelect
                    at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:94)
                    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
                    at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
                    at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
                    at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
                    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
                    at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
                    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.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:936)
                    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 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:38)
                    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: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.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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
                    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.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(Thread.java:619)


            • 4. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
              Alexander Seitz Newbie

              Hi,


              I had a similar problem recently when I tried to implement a binding to a richfaces datatable.


              After some investigation I found out that this seems to be a classloader problem. There are two classloaders, one for the application and one for the web-layer.


              I could partially solve the problem by setting these to parameters from false to true in my jboss-service.xml (from JBoss AS):



              <attribute name="Java2ClassLoadingCompliance">true</attribute>
              <attribute name="UseJBossWebLoader">true</attribute>



              Changig this helped with the main problem but raised another problem with seam-pdf (image tags in pdf templates throwing errors).


              So if anybody has a solution to this confusing problem, I would also be very happy!


              Regards,


              Alexander

              • 6. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                Alexander Seitz Newbie

                Maybe one of the Seam guys can give us a hint on how to really solve the problem?


                I don't really know whether this is a Jboss problem, a Seam problem or a Richfaces problem...

                • 7. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                  Chris Lambert Newbie

                  Alexander Seitz wrote on Nov 10, 2008 13:06:


                  Hi,

                  I had a similar problem recently when I tried to implement a binding to a richfaces datatable.

                  After some investigation I found out that this seems to be a classloader problem. There are two classloaders, one for the application and one for the web-layer.

                  I could partially solve the problem by setting these to parameters from false to true in my jboss-service.xml (from JBoss AS):


                  <attribute name="Java2ClassLoadingCompliance">true</attribute>
                  <attribute name="UseJBossWebLoader">true</attribute>



                  Changig this helped with the main problem but raised another problem with seam-pdf (image tags in pdf templates throwing errors).

                  So if anybody has a solution to this confusing problem, I would also be very happy!

                  Regards,

                  Alexander


                  Hi
                  Did You resolve this problem?

                  • 8. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                    Giorgio Grillini Newbie

                    The problem you're facing is a well known jar packaging problem which can be described as follows:
                    1-you need to use some classes like for example org.richfaces.component.html.HtmlTree wich is on on richfaces-ui.jar in an application ejb.jar bean. seam-gen generate an ear with only richfaces-api.jar on the ear classpath


                    2-In order to solve that you put on the ear classpath (the ear's main directory) richfaces-ui.jar and richfaces-impl.jar so that there are two copy of these jars, one in ear's main directory (referenced by the ejb.jar manifest) and one in war's WEB-INF/lib


                    3-Now a cast like this on a bean:


                    (HtmlTree) event.getComponent()



                    will result in a java.lang.ClassCastException: org.richfaces.component.html.HtmlTree cannot be cast to org.richfaces.component.html.HtmlTree. This is due to the fact that there are two copy of the same class loaded by 2 different classloaders (ear: jboss, war: tomcat)


                    We've tried to delete richfaces-ui.jar and richfaces-impl.jar from the war's WEB-INF/lib but this error happened:
                    org.jboss.deployers.spi.DeploymentException: URL vfsfile:/home/giorgio/software/jboss-5.0.0.GA/server/default/deploy/fc-ear.ear/fc.war/ deployment failed


                    We've also tried to change Java2ClassLoadingCompliance and UseJBossWebLoader but nothing happened (same DeploymentException). In jboss 5.0.0GA these attributes are in jboss-5.0.0.GA/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml and not in jboss-service.xml (are you using jboss4.2.x??)


                    Moreover this is not a good solution since it breaks jboss war/ear isolation. In this forum there are a huge amount of posts regarding richfaces jar packaging and classloader issues. It seems that no one is giving a real solution to this issue...
                    Is richfaces really supported in a seam-gen application?? With this problem you can't even get the selected node in a tree or programmatically create richfaces components! That is very weird!!


                    We're running Jboss 5.0.0GA, jboss-seam-2.1.1.GA and Richfaces 3.3.0



                    • 9. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                      Nicola Ben Novice
                      Hi,
                      in JBoss 5.0.1.GA there's an issue with UseJBossWebLoader=true

                      [JBoss 5.0.1 bug=>https://jira.jboss.org/jira/browse/JBAS-6763]

                      Try and use jboss-4.2.3.GA.
                      Setting UseJBossWebLoader=true works for me and I don't have problems with richfaces.
                      Anyway with that option activated there are problems deploying more applications in the same AS.

                      Richfaces problems discussed in this forums should be clarified.

                      Bye,
                      Nicola
                      • 10. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                        Giorgio Grillini Newbie

                        Hi Nicola,
                        Unfortunately I cannot use UseJBossWebLoader trick because my target environment has multiple application deployed...


                        I totally agree with you that Richfaces problems discussed in this forums should be clarified samples are confused and don't work at all!
                        Even examples in My Link don't work on jboss and seam! For example the rich:tree component has the classcast exception issue. In fact when the demo crash (it happens frequently...) you can see from the seam.debug page that they are using seam and tomcat5.5! Wonderful isn't it? :-)
                        I hope this thread:
                        My Link
                        will lead to some results!

                        • 11. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                          Nicola Ben Novice

                          Hi,
                          I opened a Jira request to improve the Seam manual, adding some more explication to Richfaces and Seam integration.
                          I hope this helps.


                          JBSEAM-4164


                          Bye
                          Nico

                          • 12. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                            Giorgio Grillini Newbie

                            Hope this can help to improve Seam manual: My Link maybe i'll write Italian version too :-)
                            Thanks a lot!
                            Giorgio

                            • 13. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                              Roman Podlesny Newbie

                              I think I solve this problem. I extract richfaces libs from the war to ear/lib and add manifest to the web-module. In this manifest I set Class-Path to the ear/lib richfaces libraries.
                              this block of code runs without ClassCastException


                               public void selectNode(NodeSelectedEvent event) {
                                      Object obj = event.getSource();        
                                      System.out.println("Event loader - event " + event.getClass().getClassLoader().toString());
                                      System.out.println("Event loader - source " + obj.getClass().getClassLoader().toString());
                                      if(obj instanceof org.richfaces.component.html.HtmlTree) {
                                          org.richfaces.component.html.HtmlTree tree = (org.richfaces.component.html.HtmlTree) obj;
                                          System.out.println(" -------------   Class Name " + tree.getClass().getCanonicalName());
                                      }
                              
                                      //HtmlTree tree = (HtmlTree) event.getSource();
                                      TreeNode currentNode = ((HtmlTree) event.getSource()).getModelTreeNode();
                                      item = (ClassifierItem)currentNode.getData();
                                  }



                              • 14. Re: java.lang.NoClassDefFoundError:org.richfaces.component.html.HtmlInplaceSelect
                                Jinping Zheng Newbie

                                Can you post a copy of manifest? Where did you put the file under the folder Web-module or WEB-INF/classes? Thanks.