users@glassfish.java.net

Re: Embedded testing woes

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Apr 2010 15:22:44 PDT

Let me try to explain and answer the questions. (Let me know if I missed some in this long thread):

EJBContainer.createEJBContainer() does search the classpath for any jar or directory that contains EJBs (either looking at annotations or at deployment descriptors). If more than one EJB module (i.e. dir or jar) is found, a temp ear file is created so that EJBs in those modules can access each other through Local interfaces.

Embeddable EJB container API in GlassFish (in its first version) is implemented to work easily against an existing GlassFish installation using glassfish-embedded-static-shell.jar from glassfish/lib/embedded directory (see http://docs.sun.com/app/docs/doc/821-1208/gjlde?a=view and http://docs.sun.com/app/docs/doc/821-1208/giide?a=view). If such jar is used, the code calculates where the install location is, and the domain.xml is.

If you are using a different (non-default) setup, you need to specify either the org.glassfish.ejb.embedded.glassfish.installation.root property or org.glassfish.ejb.embedded.glassfish.instance.root, or both to point to the actual locations.

We didn't have enough time to sort out all other approaches, so if it works in maven without GlassFish install by adding a domain.xml to the classpath, please blog about it for now and file an RFE for us to look at this setup in the next version.

To see what the EJB container is doing undecover, set the javax.enterprise.system.container.ejb.level to FINE in the JDK logging.properties (and java.util.logging.ConsoleHandler.level to FINEST so that you see them).

The logging level from the persistence.xml should work (check that what you are changing is in the classpath and that java.util.logging.ConsoleHandler.level doesn't suppress the output).

The EJBContainer.createEJBContainer() deploys EJB modules, and <ejbcontainer>.close() undeploys them (there is no option to survive embedded container redeployment), so if the ddl-generation is set to drop-and-create-tables, that what we will do. If you don't need the drop part or all of it, comment it out.

HTH,
-marina
[Message sent by forum member 'mvatkina']

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