开发者

Adding external jars to EJB project using EAR content folder

开发者 https://www.devze.com 2023-02-25 07:51 出处:网络
i have EAR and an EJB project. I noticed eclipse (sts) creates and earContent folder so I assume this is where I need to add external jars.

i have EAR and an EJB project. I noticed eclipse (sts) creates and earContent folder so I assume this is where I need to add external jars.

I added my hibernate an开发者_Go百科d log4j jars on this folder but my EJB classes cannot resolve Logger class and hibernate classes.

What's the correct way of adding these jars? or should I just add them to the EJB build path?


  • Add jars to ear project EarContent folder
  • In Eclipse Right click ejb project, Properties
  • Deployment Assembly - Manifest Entries - Add
  • Choose your jars to add, OK
  • OK
  • jars now added to manifest in ejb project, should work.

I'm looking at this in a project for the first time, I'd be very surprised if there wasn't a better solution to this that doesn't require Maven. The Java EE Tools - Update EAR Libraries option looks particularly suspicious, but doesn't seem to do the above. Note I'm on Helios still.


Add those jars under folder EarContent/lib directly , then all is done.

I.E., EarContent/lib/foo.jar will work but EarContent/lib/dir/foo.jar won't.

0

精彩评论

暂无评论...
验证码 换一张
取 消