NoClassDefFoundError when calling home interface from Action

Discussions

EJB design: NoClassDefFoundError when calling home interface from Action

  1. Hi to all

    I am developing a web applicatoin on Struts Framework using WSAD 5.1 The problem I got is when I try to call an EJB home from my Struts action class, I always got NoClassDefFoundError. Any idea what will cause this error?

     

    Caused by: java.lang.NoClassDefFoundError: businessCalendarService.BusinessCalendarServiceHome
    at poc.actions.BCSAction.numberOfWorkingDays(BCSAction.java:86)
  2. Hi to allI am developing a web applicatoin on Struts Framework using WSAD 5.1 The problem I got is when I try to call an EJB home from my Struts action class, I always got NoClassDefFoundError. Any idea what will cause this error? Caused by: java.lang.NoClassDefFoundError: businessCalendarService.BusinessCalendarServiceHome at poc.actions.BCSAction.numberOfWorkingDays(BCSAction.java:86)

    Hi there

    You'll need to have the your EJB classes (eg. the BusinessCalendarServiceHome class) in the WEB-INF directory of your web application, either in the classes directory or packaged into a jar file in the lib directory.

    Although in this case the class that is missing is one of your own classes, when getting a NoClassDefFoundError message which refers to a third party class, you can also try using Jarhoo (http://www.jarhoo.com) to find which jar file you need in your classpath.

    Michael
  3. If the EJB module is in the same enterprise application as your web module, you need only put the EJB module name on the web module's Manifest Class-Path. In WSAD, open the web application project properties. Select Java JAR Dependencies. Select the JAR (EJB project) that your EJB is in. WSAD will make an entry on the Web module's MANIFEST.MF class path.

    Bill Lasley
    Versant Corp.
    http://www.versant.com
  4. Were you able to find a solution to this issue, I'm facing the same problem

    Thanking you in advance,
    Thanks