java.lang.RuntimeException

Oracle Community | nicolascova | 6 years ago
  1. 0

    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.

    Java.net JIRA | 6 years ago | szczyp
    org.glassfish.deployment.common.DeploymentException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.glassfish.deployment.common.DeploymentException

      No message provided

      at org.glassfish.appclient.server.core.NestedAppClientDeployerHelper$JARArtifact.processArtifact()
    2. org.glassfish.appclient
      AppClientDeployer.generateArtifacts
      1. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper$JARArtifact.processArtifact(NestedAppClientDeployerHelper.java:941)
      2. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper.addJar(NestedAppClientDeployerHelper.java:466)
      3. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper.addJARsFromDir(NestedAppClientDeployerHelper.java:402)
      4. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper.addLibraryJARs(NestedAppClientDeployerHelper.java:413)
      5. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper.processDependencies(NestedAppClientDeployerHelper.java:324)
      6. org.glassfish.appclient.server.core.NestedAppClientDeployerHelper.<init>(NestedAppClientDeployerHelper.java:134)
      7. org.glassfish.appclient.server.core.AppClientDeployerHelper.newInstance(AppClientDeployerHelper.java:111)
      8. org.glassfish.appclient.server.core.AppClientDeployer.createAndSaveHelper(AppClientDeployer.java:293)
      9. org.glassfish.appclient.server.core.AppClientDeployer.generateArtifacts(AppClientDeployer.java:281)
      9 frames
    3. Deployment Related JavaEE Core Classes
      JavaEEDeployer.prepare
      1. org.glassfish.javaee.core.deployment.JavaEEDeployer.prepare(JavaEEDeployer.java:209)
      1 frame
    4. Kernel Classes
      ApplicationLifecycle.prepareModule
      1. com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
      1 frame
    5. Deployment Related JavaEE Full Profile Classes
      EarDeployer.prepare
      1. org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:269)
      2. org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79)
      3. org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131)
      4. org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129)
      5. org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197)
      6. org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:248)
      7. org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129)
      7 frames
    6. Kernel Classes
      ApplicationLifecycle.deploy
      1. com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
      2. com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
      3. com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
      3 frames
    7. Embedded GlassFish Web
      DeployCommand.execute
      1. org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
      1 frame
    8. Kernel Classes
      AdminAdapter.service
      1. com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
      2. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
      3. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
      4. com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
      5. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
      6. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
      7. com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
      8. com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
      8 frames
    9. Grizzly WS
      GrizzlyAdapter.service
      1. com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
      1 frame
    10. Kernel Classes
      ContainerMapper.service
      1. com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
      2. com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
      2 frames
    11. Grizzly WS
      AbstractThreadPool$Worker.run
      1. com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      2. com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      3. com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      4. com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      5. com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      6. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      7. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      8. com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      9. com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      10. com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      11. com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      12. com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      13. com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      13 frames
    12. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:619)
      1 frame