Section 8.1.1.2 of the J2EE 1.3 specification mandates explicit support for the bundling of dependent .jar files via the Extension Mechanism Architecture (see the References section). Application servers must load dependent .jar files listed in the Manifest Class-Path entry of a primary .jar file (typically an EJB .jar). This requirement is not mandated for .ear or .war files.
As of Service Pack 2 of WebLogic 6.1 (WebLogic issue 056911 -- see the References section below), .jar files listed in a Manifest Class-Path entry are loaded by the application's EJB class loader. This applies to Manifest Class-Path entries found in EJB .jar files and web application .war files within the .ear. Note that the Manifest Class-Path approach is only supported when deploying components within an .ear.
我测试用的目录结构是这样的:application目录下有一些ejb .jar文件,有一个certificate.war,soap.war,还有一个DefaultWebapp目录。我写了一个StatefulAccount ejb,打包StatefulAccount.jar,它用到的帮助类打包成helper.jar,这两个jar文件都在application目录下。在StatefulAccount.jar的清单文件中,加入了Class-Path: helper.jar。部署ejb的时候没有问题,就是在运行的时候抛出ClassDefNotFound异常。这个异常说明找到了类文件,应该是类文件的格式不对。
为什么会这样呢?