How to include external jar in ejb-jar

若如初见. 提交于 2020-01-17 06:08:10

问题


How can I include external jar file in my ejb3 jar file? There is one external jar project with all helper classes and manifest.mf file. Now I have this jar in my classpath in eclipse. But when eclipse build the ejb-jar I want it to include this external jar file so in Application server when my ejb loads and run it can use classes in external jar. Right now I am adding a reference in Manifest.mf for ejb-jar, still when eclipse build the ejb-jar it is not packaging this external jar and during runtime I am getting ClassNotFoundException.

Can somebody please give me an example how to achieve this? I am using Eclipse 3.6 and EJB3


回答1:


You have to create ear or war deployment and include your ejb.jar and a third-party.jar into it. Then deploy it to jboss




回答2:


I found a solution. Method 2 Worked for me. the tutorial uses Rational, but I assume Eclipse will be similar. http://www.ibm.com/developerworks/rational/library/07/1211_schrag/index.html check it out.



来源:https://stackoverflow.com/questions/5212487/how-to-include-external-jar-in-ejb-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!