Vishwanath Krishnamurthi's blog

A blog on Java EE, clean code, open source and TDD

Where to place the Java EE descriptors ?

with one comment

No intro required – these are some of the standard descriptors used in a JavaEE application. However placing these descriptors in the wrong location is a common mistake.

So here’s a list of some descriptors and the correct location they are expected in – Might save some time searching around the net.

ejb-jar.xml

In a Jar, it would go in /META-INF directory
In a War, it would go in /WEB-INF directory

beans.xml

In a Jar, it would go in /META-INF directory
In a War, it would go in /WEB-INF directory.

But note that just because you have WEB-INF/beans.xml, the JARs in WEB-INF/lib do not become bean-archives.
The JAR would need a META-INF/beans.xml separately

persistence.xml

In a Jar, it would go in /META-INF directory
It would go under WEB-INF/classes/META-INF in a WAR

application.xml

In /META-INF directory of Ear

Advertisements

Written by Vishwanath Krishnamurthi

August 25, 2012 at 11:08 am

One Response

Subscribe to comments with RSS.

  1. Thanks for such a precise blog. It helped me very much in my critical time. Thumbs up.

    Madhuri

    November 7, 2013 at 10:37 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: