users@glassfish.java.net

Embedded EJBContainer fails to instantiate when SSB is also a WebService

From: N W <emailnbw_at_gmail.com>
Date: Tue, 30 Aug 2011 14:16:50 -0400

I've been running unit/integration testing using the GF embedded EJB container with GF v3.1 (bld 43) and that has been working fine. That is until I added a new local stateless session bean which is also annotated with @WebService. When I added that new EJB existing tests which don't even use that new bean fail to create the embedded container.

The embedded container is initialized and created like so:

     Map<String, Object> p = new HashMap<String, Object>();
     p.put(EJBContainer.APP_NAME, "foo");
     p.put(EJBContainer.MODULES, new File("out/production/FOO"));
     p.put("org.glassfish.ejb.embedded.glassfish.installation.root", "C:/glassfish3/glassfish");
     ejbC = EJBContainer.createEJBContainer(p);

The exception I get when createEJBContainer(p) is called is:

SEVERE: EJB6001:Caught exception instantiating EmbeddedContainer.
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
   at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:145)
   at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)
   at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)


When deployed in production the app is packaged as a single WAR and everything works fine. Is this a bug or am overlooking some additional configuration step for the embedded container now that I have introduced this @Stateless/_at_WebService class?

Thanks,

-Noah