NoClassDefFoundError when deploying EAR

Solution: Fix your EAR package structure:

Wrong Right
Wrong Right

Eclipse project setup

Further information:

  1. All projects/ files have been created with Eclipse
  2. application.ear: Exported as “Enterprise Application Project”
  3. app-ejb.jar: Exported as “Enterprise Java Beans Project”
  4. app-web.war: Exported as “Dynamic Web Project”
  5. app-shared.jar: Exported as “Java Project”, that contains classes that are used by more than one of the sub-projects. Can also be a third party jar-File with library classes.
  6. Exception occurs, since app-web.war or app-ejb.jar may be deployed just before app-shared.jar has been deployed. A workaround for that would be to first deploy app-shared.jar separately and remove it from your enterprise application compilation.