Vishwanath Krishnamurthi's blog

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

Posts Tagged ‘ejb-jar.xml beans.xml persistence.xml location meta-inf web-inf

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