7 Replies Latest reply on Apr 28, 2011 2:16 AM by surajchhetry

    NoClassDefFound from EJB accessing third-party jar located in EAR

    rhinmass

      I am using JBoss 6.0.0.Final and I am getting a NoClassDefFound error when trying to load a class that is in a jar that is in my EAR outside of my ejb.jar or war.jar.  The structure of the ear is as follows:  (I am using Maven ear plugin)

       

       

      +META-INF

      |       |

      |      +application.xml

      |

      +ejb.jar

      |       |

      |      +META-INF

      |       |      |

      |       |     +beans.xml

      |       |     +MANIFEST.MF

      |       |

      |      +com/ejb/SimpleMessageBean.class

      |

      +rest.war

      |        |

      |      +META-INF

      |       |      |

      |       |     +MANIFEST.MF

      |       |

      |      +WEB-INF

      |              |

      |             +classes/com/webapp/RestResource.class

      |             +lib/simple.jar

      |             +beans.xml

      |

      +simple.jar

              |

             +META-INF

             +com/simple/Simple.class

       

      I am getting NoClassDefFoundError: com/simple/Simple when I try to use this class from SimpleMessageBean.  I am able to use Simple.class from RestResource though.  Of course that isn't surprising since Maven ear plugin is putting a copy of it under WEB-INF/lib.

       

      All the MANIFEST.MF's are default with no Class-Path declared.  Do I need a jboss-app.xml or do I need to put something in any of the MANIFEST.MFs.

       

      Thanks for any assistance!

       

      Robin