File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes packaging EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "packaging EAR" Watch "packaging EAR" New topic

packaging EAR

Neha Sen

Joined: May 27, 2009
Posts: 20
this question may be very silly. I have a class say ClassX which referred in my web application module as well as ejb module. But my ejb module (ejb.jar) and web application module(web.war) are both packaged in same ear. Do I need to add ClassX in both war and jar separately? Because both war and jar are finally added in one ear.
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

You can add the ClassX or I should say a jar containing that class in the EAR. Then I think you need to add that jar in the of both the EJB and WAR modules which usually IDEs do automatically...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Neha Sen

Joined: May 27, 2009
Posts: 20
I do not know how you do with IDE, i use eclipse.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

You don't need two copies. The war can't point to the jar.

Eclipse is an IDE. Usually when you set a dependency in the project preferences, the manifest is updated.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Neha Sen

Joined: May 27, 2009
Posts: 20
thank you Jeanne.
I agree. Here's the link:
subject: packaging EAR
jQuery in Action, 3rd edition