java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException

Jenkins JIRA | sorehead | 6 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0

    When i try to deploy an ear with the deploy-plugin i got the following error: {code} FATAL: org/apache/tools/ant/BuildException java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.<init>(DefaultConfigurationFactory.java:48) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:79) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:72) at hudson.FilePath.act(FilePath.java:756) at hudson.FilePath.act(FilePath.java:738) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:72) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:622) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:762) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:548) at hudson.model.Run.run(Run.java:1386) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 16 more {code} It does not matter which application server I choose. I put the following libraries in lib-folder of the jenkins: cargo-ant-1.0.5.jar cargo-core-api-container-1.0.5.jar cargo-core-api-generic-1.0.5.jar cargo-core-api-module-1.0.5.jar cargo-core-api-util-1.0.5.jar cargo-core-container-jboss-1.0.5.jar cargo-core-tools-jboss-deployer-5.1-and-onwards-1.0.5.jar cargo-core-uberjar-1.0.5.jar jboss-jmx-remoting.jar jboss-remoting-aspects.jar jboss-remoting.jar

    Jenkins JIRA | 6 years ago | sorehead
    java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
  2. 0

    When i try to deploy an ear with the deploy-plugin i got the following error: {code} FATAL: org/apache/tools/ant/BuildException java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException at org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.<init>(DefaultConfigurationFactory.java:48) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:79) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:72) at hudson.FilePath.act(FilePath.java:756) at hudson.FilePath.act(FilePath.java:738) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:72) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:622) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:762) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:548) at hudson.model.Run.run(Run.java:1386) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 16 more {code} It does not matter which application server I choose. I put the following libraries in lib-folder of the jenkins: cargo-ant-1.0.5.jar cargo-core-api-container-1.0.5.jar cargo-core-api-generic-1.0.5.jar cargo-core-api-module-1.0.5.jar cargo-core-api-util-1.0.5.jar cargo-core-container-jboss-1.0.5.jar cargo-core-tools-jboss-deployer-5.1-and-onwards-1.0.5.jar cargo-core-uberjar-1.0.5.jar jboss-jmx-remoting.jar jboss-remoting-aspects.jar jboss-remoting.jar

    Jenkins JIRA | 6 years ago | sorehead
    java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
  3. 0
    samebug tip
    A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add with the following: <groupId>com.fasterxml</groupId> <artifactId>classmate</artifactId> <version>1.0</version>
  6. 0
    samebug tip
    Check if you didn't forget to instantiate your topic in the kafka broker.
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.ClassNotFoundException

    org.apache.tools.ant.BuildException

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    5 frames
  3. Cargo Core Uberjar
    DefaultConfigurationFactory.<init>
    1. org.codehaus.cargo.generic.configuration.DefaultConfigurationFactory.<init>(DefaultConfigurationFactory.java:48)
    1 frame
  4. Deploy to container Plugin
    CargoContainerAdapter$1.invoke
    1. hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:79)
    2. hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:72)
    2 frames
  5. Hudson
    FilePath.act
    1. hudson.FilePath.act(FilePath.java:756)
    2. hudson.FilePath.act(FilePath.java:738)
    2 frames
  6. Deploy to container Plugin
    DeployPublisher.perform
    1. hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:72)
    2. hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45)
    2 frames
  7. Hudson
    AbstractBuild$AbstractRunner.performAllBuildSteps
    1. hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
    2. hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:622)
    3. hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601)
    3 frames
  8. Hudson Maven Embedder
    MavenModuleSetBuild$RunnerImpl.post2
    1. hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:762)
    1 frame
  9. Hudson
    Run.run
    1. hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:548)
    2. hudson.model.Run.run(Run.java:1386)
    2 frames
  10. Hudson Maven Embedder
    MavenModuleSetBuild.run
    1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
    1 frame
  11. Hudson
    Executor.run
    1. hudson.model.ResourceController.execute(ResourceController.java:88)
    2. hudson.model.Executor.run(Executor.java:145)
    2 frames