javax.ejb.EJBException: Failed to deploy EJB modules - see log for details

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Please see the attached application - it uses glassfish-embedded-all final (at least I think it is final, this is the jar with the latest date as of now) from http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-all/3.0.1. When the embedded EJB container is created with the call to: EJBContainer.createEJBContainer() the glassfish jar itself is on the classpath, and as it included META-INF/ejb-jar.xml is is treated as a valid EJB archive and the deployer tries to deploy its EJBs, which fails with: SEVERE: Exception while invoking class com.sun.enterprise.web.WebDeployer prepare method java.lang.NullPointerException at com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:567) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:264) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144) at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) Jul 1, 2010 1:39:35 PM org.glassfish.javaee.full.deployment.EarDeployer prepareBundle WARNING: Error occurred java.lang.NullPointerException at com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:567) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:264) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144) at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) Jul 1, 2010 1:39:35 PM org.glassfish.api.ActionReport failure SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method org.glassfish.deployment.common.DeploymentException at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:148) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144) at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) Caused by: java.lang.NullPointerException at com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:567) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:264) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129) ... 9 more Jul 1, 2010 1:39:35 PM org.glassfish.api.ActionReport failure SEVERE: Exception while preparing the app org.glassfish.deployment.common.DeploymentException at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:148) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214) at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144) at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) Caused by: java.lang.NullPointerException at com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:567) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:264) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129) ... 9 more Jul 1, 2010 1:39:35 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer INFO: [EJBContainerProviderImpl] Cleaning up on failure ... Jul 1, 2010 1:39:35 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown INFO: JMXStartupService and JMXConnectors have been shut down. Jul 1, 2010 1:39:35 PM com.sun.enterprise.v3.server.AppServerStartup stop INFO: Shutdown procedure finished Jul 1, 2010 1:39:35 PM AppServerStartup run INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting Jul 1, 2010 1:39:35 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer SEVERE: ejb.embedded.exception_instantiating javax.ejb.EJBException: Failed to deploy EJB modules - see log for details at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) Exception in thread "main" javax.ejb.EJBException: No EJBContainer provider available The following providers: org.glassfish.ejb.embedded.EJBContainerProviderImpl Returned null from createEJBContainer call. at javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:186) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:121) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.test.EmbeddedEJBTest.main(EmbeddedEJBTest.java:16) The problem seems to be the org.glassfish.ejb.embedded.EJBContainerProviderImpl#skipJar() method - it doesn't recognize this jar as glassfish's jar - its MANIFEST.MF doesn't have some 'skip' attributes. The workaround is to specify the name of the module, like so: Map<Object, Object> properties = new HashMap<Object, Object>(); properties.put(EJBContainer.MODULES, "bin"); // bin is the eclipse output folder ejb = EJBContainer.createEJBContainer(properties); and then it works fine.
    via by szczyp,
  • Exercise 5: EJB Embedded ---> Problem running the test
    via by manuel emilio araujo,
  • Enterprise Java Beans Deployment
    via Stack Overflow by ilya8891
    ,
    • javax.ejb.EJBException: Failed to deploy EJB modules - see log for details at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135) at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102) at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78) at com.bypa.notificationservice.location.GeoCoderServiceTest.setUpClass(GeoCoderServiceTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,