java.lang.NoClassDefFoundError: com/sun/jdmk/snmp/SnmpPduFactoryBER

Coderanch | sachin kataria | 9 years ago
  1. 0

    error during executing java-snmp program...

    Coderanch | 9 years ago | sachin kataria
    java.lang.NoClassDefFoundError: com/sun/jdmk/snmp/SnmpPduFactoryBER
  2. 0

    JES Application Server 2005Q1

    Oracle Community | 1 decade ago | 807581
    java.lang.NoClassDefFoundError: com/sun/jdmk/remote/cascading/CascadingAgent
  3. 0

    could not find the main class ! exception.

    Oracle Community | 1 decade ago | 807569
    java.lang.NoClassDefFoundError: snmp/SNMPGetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    could not find the main class ! exception.

    Oracle Community | 1 decade ago | 807569
    java.lang.NoClassDefFoundError: snmp/SNMPGetException
  6. 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
    java.lang.NoClassDefFoundError: com/sun/javadoc/Doclet

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      com/sun/jdmk/snmp/SnmpPduFactoryBER

      at javax.management.snmp.manager.SnmpPeer.<init>()
    2. javax.management.snmp
      SnmpPeer.<init>
      1. javax.management.snmp.manager.SnmpPeer.<init>(SnmpPeer.java:123)
      1 frame
    3. Unknown
      SystemInfo.main
      1. SystemInfo.getDetails(SystemInfo.java:29)
      2. SystemInfo.main(SystemInfo.java:147)
      2 frames