java.lang.NoClassDefFoundError

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.

  • Glassfish V3 custom realm issue
    via by anaq,
  • 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,
  • Struts2 Hello World jsp example error
    via Stack Overflow by lulu88
    ,
  • mvn clean failing on junit tests.
    via by google_user,
    • java.lang.NoClassDefFoundError: com/sun/enterprise/security/auth/realm/IASRealm at java.lang.ClassLoader.findBootstrapClass(Native Method) at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:882) at java.lang.ClassLoader.loadClass(ClassLoader.java:298) at java.lang.ClassLoader.loadClass(ClassLoader.java:296) at java.lang.ClassLoader.loadClass(ClassLoader.java:296) at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:174) at java.lang.ClassLoader.loadClass(ClassLoader.java:296) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at com.sun.enterprise.security.auth.realm.Realm.doInstantiate(Realm.java:276) at com.sun.enterprise.security.auth.realm.Realm.instantiate(Realm.java:183) at com.sun.enterprise.security.auth.realm.RealmConfig.createRealms(RealmConfig.java:74) at com.sun.enterprise.security.SecurityLifecycle.createRealms(SecurityLifecycle.java:308) at com.sun.enterprise.security.SecurityLifecycle.onInitialization(SecurityLifecycle.java:195) at com.sun.enterprise.security.SecurityLifecycle.postConstruct(SecurityLifecycle.java:264) at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174) at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87) at java.security.AccessController.doPrivileged(Native Method) at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84) at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77) at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58) at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107) at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60) at com.sun.enterprise.security.SecuritySniffer.setup(SecuritySniffer.java:105) at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:99) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:703) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:451) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262) at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:340) at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:292) at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

    Users with the same issue

    Unknown visitor1 times, last one,
    junior_cEngineer
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    andyglick
    2 times, last one,
    81 more bugmates