Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding external jars to EJB project using EAR content folder

Tags:

project

ejb

ear

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 and 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?

like image 780
sonx Avatar asked Dec 17 '22 15:12

sonx


1 Answers

  • 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.

like image 89
paprika Avatar answered Mar 24 '23 23:03

paprika