users@glassfish.java.net

Re: GlassFish v3 embedded in Maven?

From: <glassfish_at_javadesktop.org>
Date: Tue, 27 Jan 2009 00:13:28 PST

We are doing something like that, with Jetty/Resin embedded, so it's not the same, but just in case it provides some ideas...

.- We don't start the server/demo with Maven (we use Ant+Ivy but anyway) but what we do is create a .jar file with the appropriate manifest so it can be double-clicked and start. Starting it from Ant would be an option, but we wanted to be able to use the demo without Ant as well.
.- The server opens a small window that displays the status of the server, enables the user to see the console log (that captures the standard err, out and Log4J streams) and allows the user to stop the server.
.- The database used is HSQLDB and the datasource descriptor is created/configured by Ant at deploy time, so there's no need for the user to configure external datasources.
.- The web app itself is independent of the container embedded code, and this allows us to deploy basically the same "bundle" into a regular web container, as well as testing it with different embedded ones.

I'm quite satisfies with the result, the only issue being that a .jar file does not allow you to set JVM parameters unless you use a wrapper/launcher library, so if you need that you need to either provide a shell script or wrap your .jar in a launcher library but that means you are spawning 2 JVMs so...

Anyway, just in case it helps.
D.
[Message sent by forum member 'greeneyed' (greeneyed)]

http://forums.java.net/jive/thread.jspa?messageID=328334