在我的WAS 6.1上,我在EAR中部署了一个EJb,EJb使用了log4j。尝试通过远程客户端调用EJb时出现此错误:
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.Priority
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:69)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
at com.bmo.olbb.prs.integration.service.util.PRSUtil.<clinit>(PRSUtil.java:13)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority
在installedapps directroy中,在EAR文件夹中,我有EJB jar和log4j-1.2.15.jar。那我为什么要这个呢?问题是它如何同时成为ClassNotFoundException和NoClassDefFoundError?
答案 0 :(得分:1)
您是否将log4j jar添加到EJB jar的meta-inf/Manifest.mf
文件中?
Manifest-Version: 1.0
Class-Path: log4j-1.2.15.jar