In JBoss EAP EJBs referencing Richfaces components causes NoClassDefFoundErrors or ClassCastExceptions

Solution Verified - Updated -

Issue

  • NoClassDefFoundError Exception is occuring in deployment time on JBoss Enterprise Application Platform 5 when Richfaces classes is referenced in EJB components. This error can also occurs with other Richfaces components.

    2009-11-11 17:03:37,956 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfsfile:/opt/apps/jboss/jboss-eap-5.0/jboss-as/server/default/deploy/myproject-ear.ear/ state=PreReal mode=Manual requiredState=Real
    org.jboss.deployers.spi.DeploymentException: Error deploying myproject-ejb.jar: org/richfaces/component/html/HtmlMenuItem
         at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
         at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
         at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
             ...
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlMenuItem
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
         at java.lang.Class.getDeclaredMethods(Class.java:1791)
         ...
         at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.<init>(BeanInterceptorMetaDataBridge.java:138)
    

Environment

  • JBoss Enterprise Application Platform (EAP)

    • 4.x
    • 5.x
  • Seam

    • 2.0.2-fp
    • 2.2.EAP5
  • Richfaces 3.3.x
  • Enterprise Java Beans (EJB) 3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.