users@glassfish.java.net

RE: ear file structure

From: Shevland, Joe <joe.shevland_at_capgemini.com>
Date: Mon, 9 Jul 2007 15:33:29 +1000

> Sorry if I have to ask this question, but I've searched
> through the forum but could not find the relevant answer.
> Currently I am migrating my jboss-seam apps to be deployable
> on Glassfish. But it seems that glassfish has a different ear
> structure with other appserver.
>
> My question is:
> 1. Where do I put my library in the ear file?
> This structure is not recognized in glassfish:
>
> myapps.ear
> |-- META-INF
> |--|--application.xml
> |-- mylibrary.jar
> |-- anotherlibrary.jar

It'll recognize those. Are you seeing ClassNotFoundException's or
something?

> 2. What do I have to write in application.xml if I want my
> library (that I mentioned in previous point) to be included?
> This doesn't seem to work:
> <module>
> <java>mylibrary.jar</java>
> </module>
> <module>
> <java>anotherlibrary.jar</java>
> </module>
>
> Since *I think* glassfish will recognize it as an application client.

By doing that, you're telling GF those two libraries are application
clients (not what you're after). For support libs just having them in
the root of the EAR should be fine (if all modules require them,
otherwise WEB-INF/lib for a web app etc), nothing needed in
application.xml. I think now with EE 5 by default you can put libraries
under <ear_root>/lib too, a configurable property that can be pointed
elsewhere.

Cheers
Joe

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.