Uploaded image for project: 'Maven Site Plugin'
  1. Maven Site Plugin
  2. MSITE-467

org.apache.maven.plugins.site.SiteMojo#execute() caused a linkage error: java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: multi module
    • Labels:
      None
    • Environment:
      Windows XP SP3, Maven 2.2.1, JDK 1.6.0_18

      Description

      If I run mvn clean site on the attached test-app project in the top directory, I get following error:

      [FATAL ERROR] org.apache.maven.plugins.site.SiteMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check
       the realms:
      [FATAL ERROR] Plugin realm = app0.child-container[org.apache.maven.plugins:maven-site-plugin:2.1]
      urls[0] = file:/d:/repo/org/apache/maven/plugins/maven-site-plugin/2.1/maven-site-plugin-2.1.jar
      urls[1] = file:/d:/repo/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
      urls[2] = file:/d:/repo/org/apache/maven/doxia/doxia-module-xhtml/1.1.2/doxia-module-xhtml-1.1.2.jar
      urls[3] = file:/d:/repo/org/apache/maven/doxia/doxia-core/1.1.2/doxia-core-1.1.2.jar
      urls[4] = file:/d:/repo/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar
      urls[5] = file:/d:/repo/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar
      urls[6] = file:/d:/repo/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
      urls[7] = file:/d:/repo/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
      urls[8] = file:/d:/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
      urls[9] = file:/d:/repo/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
      urls[10] = file:/d:/repo/org/apache/maven/doxia/doxia-module-apt/1.1.2/doxia-module-apt-1.1.2.jar
      urls[11] = file:/d:/repo/org/apache/maven/doxia/doxia-module-xdoc/1.1.2/doxia-module-xdoc-1.1.2.jar
      urls[12] = file:/d:/repo/org/apache/maven/doxia/doxia-module-fml/1.1.2/doxia-module-fml-1.1.2.jar
      urls[13] = file:/d:/repo/org/apache/maven/doxia/doxia-decoration-model/1.1.2/doxia-decoration-model-1.1.2.jar
      urls[14] = file:/d:/repo/org/apache/maven/doxia/doxia-site-renderer/1.1.2/doxia-site-renderer-1.1.2.jar
      urls[15] = file:/d:/repo/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
      urls[16] = file:/d:/repo/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
      urls[17] = file:/d:/repo/org/apache/velocity/velocity/1.5/velocity-1.5.jar
      urls[18] = file:/d:/repo/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
      urls[19] = file:/d:/repo/oro/oro/2.0.8/oro-2.0.8.jar
      urls[20] = file:/d:/repo/org/apache/maven/shared/maven-doxia-tools/1.2/maven-doxia-tools-1.2.jar
      urls[21] = file:/d:/repo/commons-io/commons-io/1.4/commons-io-1.4.jar
      urls[22] = file:/d:/repo/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
      urls[23] = file:/d:/repo/org/mortbay/jetty/jetty/6.1.5/jetty-6.1.5.jar
      urls[24] = file:/d:/repo/org/mortbay/jetty/jetty-util/6.1.5/jetty-util-6.1.5.jar
      urls[25] = file:/d:/repo/org/mortbay/jetty/servlet-api-2.5/6.1.5/servlet-api-2.5-6.1.5.jar
      [FATAL ERROR] Container realm = plexus.core
      urls[0] = file:/C:/maven/lib/maven-2.2.1-uber.jar
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] org/apache/tools/ant/launch/AntMain
      org.apache.tools.ant.launch.AntMain
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
              at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
              at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
              at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
              at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
              at org.apache.tools.ant.Project.initProperties(Project.java:308)
              at org.apache.tools.ant.Project.init(Project.java:295)
              at groovy.util.AntBuilder.createProject(AntBuilder.java:134)
              at groovy.util.AntBuilder.<init>(AntBuilder.java:63)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
              at org.codehaus.groovy.runtime.MetaClassHelper.doConstructorInvoke(MetaClassHelper.java:535)
              at groovy.lang.MetaClassImpl.doConstructorInvoke(MetaClassImpl.java:2356)
              at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1255)
              at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1185)
              at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:809)
              at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBytecodeAdapter.java:230)
              at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNew0(ScriptBytecodeAdapter.java:237)
              at org.codehaus.mojo.findbugs.FindBugsMojo.executeFindbugs(FindBugsMojo.groovy:689)
              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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
              at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
              at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
              at org.codehaus.mojo.findbugs.FindBugsMojo.executeReport(FindBugsMojo.groovy:523)
              at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
              at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:164)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:328)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:132)
              at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:142)
              at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:109)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
              at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
              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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.AntMain
              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 org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
              at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
              at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
              at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
              ...
      

      Test-App project infos:

      • Multi-Module with sub-sub-modules
      • Included Checkstyle Plugin 2.5
      • Reporting

      I have tested it on Windows XP SP3 with Maven 2.2.1 and JDK 1.6.0_18.

      Interesting observation is, that if I remove the Checkstyle Plugin in the parent pom, the above error doesn't appear anymore. But then I have a problem with the Checkstyle Plugin and its configuration for the reporting because I want to use the checkstyle-rules.xml in the build-tools module.

      I have configured the Checkstyle Plugin according to the website documented here:
      http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

      Thanks for help!

        Attachments

        1. test-app.zip
          10 kB
          oliver.burkhalter

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oliver.burkhalter oliver.burkhalter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: