(Note that 3.1-b41 is the latest embedded version; not sure why.)
Sometimes a deployment using the embedded API returns null. I am using code like this:
final Deployer deployer = this.glassfish.getDeployer();
final ScatteredArchive sa = new ScatteredArchive("test-classes", ScatteredArchive.Type.JAR, this.beanClassClasspathRoot);
this.deployedApplication = deployer.deploy(sa.toURI());
this.beanClassClasspathRoot evaluates to (in my case): /Users/ljnelson/Projects/ngp/ngp-dao-ejb/target/test-classes
It is a directory, it exists, and it contains all classes necessary for my EJB module.
sa.toURI() evaluates to file:/var/folders/Xd/XdAtuoEzHdOh7AR5tSGFJ++++TI/-Tmp-/test-classes.jar
The (monstrous) log, when Level.FINE is enabled, says only this:
PlainTextActionReporterFAILUREDescription: deploy AdminCommandError occurred during deployment: null. Please see server.log for more details.
Then null is returned from the deploy() method.
I cannot reliably reproduce this, so I expect that eyeball debugging will be necessary.
Despite this oddity, my test completes normally. That is, I am able to look up and run tests on my EJB.