2
votes

I am creating an EAR with 1 war file (appWeb.war is my web module) and several jar files. These jar files are NOT EJBs. We have choosen to create different jar files based on logical separation of application like the model.jar (containing all model classes, DAO, DTO and hibernate files), BO.jar (containing business logic)etc...

I wanted to know the correct packaging structure for my EAR

application.ear
.
.
....lib (folder created by us)
    .
    .
    ...strus.jar
    ...spring3.jar (all the spring library files)
    ...BO.jar
    ...model.jar

I am adding appWeb.war as the web module to my EAR in the IDE (RAD 7.5) Which creates the entry in application.ear/META-INF/application.xml

Environment details: App server: Websphere app server 7.0 IDE: RAD 7.5 It's a Struts 2, Spring 3 and Hibernate 3.6 application

Questions: 1. Is this approach correct? Where does the application specific jar files kept in an EAR? 2. We want to move the library files to application.ear/lib folder.

Any dierctions/help/best practices on this will be appreciated.

thanks

1

1 Answers

4
votes

The one you've outlined above is one of the choices available. The folder name -- in this case, "lib", is pretty much up to you, as long as you properly reference it from the MANIFEST classpath settings of the WAR file. Personally, I prefer that solution as it keeps you from tinkering with container settings and having your files "scattered" across the container tree. Just my preference, I guess.

For IBM recommended settings: http://www-01.ibm.com/support/docview.wss?uid=swg27006159

and from the community: Best Practice for including 3rd party jars in a core library?