Maven 2.x and 3.x Site Plugin

More than one version of 'org.apache.commons.logging.Log' visible in the classpath

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.1
  • Fix Version/s: 2.2
  • Component/s: site:deploy
  • Labels:
    None
  • Environment:
    Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
    Java version: 1.6.0_17
    OS name: "mac os x" version: "10.6.2" arch: "x86_64" Family: "mac"
  • Number of attachments :
    1

Description

site:deploy fails as follows (related to wagon-webdav dependencies? Commons-logging?).
Reverting to maven-site-plugin:2.0.x works around the issue.
I attach the project zip (appropriate server/dav configuration needed to reproduce the problem).

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'site'.
[INFO] org.apache.maven.plugins: checking for updates from maven2-repo-dev-java-net
[INFO] org.apache.maven.plugins: checking for updates from maven-repository.dev.java.net
[INFO] org.apache.maven.plugins: checking for updates from hosted.repos
[INFO] org.codehaus.mojo: checking for updates from maven2-repo-dev-java-net
[INFO] org.codehaus.mojo: checking for updates from maven-repository.dev.java.net
[INFO] org.codehaus.mojo: checking for updates from hosted.repos
[INFO] ------------------------------------------------------------------------
[INFO] Building CheckboxTree
[INFO]    task-segment: [site:deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [site:deploy {execution: default-cli}]
WAGON_VERSION: 1.0-beta-2
http://zeus.pin.unifi.it/projectsSites/lablib-checkboxtree_snap - Session: Disconnecting  
http://zeus.pin.unifi.it/projectsSites/lablib-checkboxtree_snap - Session: Disconnected
[FATAL ERROR] org.apache.maven.plugins.site.SiteDeployMojo#execute() caused a linkage error (java.lang.ExceptionInInitializerError) 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:/Users/bigagli/.m2/repository/org/apache/maven/plugins/maven-site-plugin/2.1/maven-site-plugin-2.1.jar
urls[1] = file:/Users/bigagli/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.1.2/doxia-module-xhtml-1.1.2.jar
urls[3] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-core/1.1.2/doxia-core-1.1.2.jar
urls[4] = file:/Users/bigagli/.m2/repository/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar
urls[5] = file:/Users/bigagli/.m2/repository/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar
urls[6] = file:/Users/bigagli/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
urls[7] = file:/Users/bigagli/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
urls[8] = file:/Users/bigagli/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
urls[9] = file:/Users/bigagli/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
urls[10] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.1.2/doxia-module-apt-1.1.2.jar
urls[11] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.1.2/doxia-module-xdoc-1.1.2.jar
urls[12] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.1.2/doxia-module-fml-1.1.2.jar
urls[13] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.1.2/doxia-decoration-model-1.1.2.jar
urls[14] = file:/Users/bigagli/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.1.2/doxia-site-renderer-1.1.2.jar
urls[15] = file:/Users/bigagli/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
urls[16] = file:/Users/bigagli/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
urls[17] = file:/Users/bigagli/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
urls[18] = file:/Users/bigagli/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
urls[19] = file:/Users/bigagli/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
urls[20] = file:/Users/bigagli/.m2/repository/org/apache/maven/shared/maven-doxia-tools/1.2/maven-doxia-tools-1.2.jar
urls[21] = file:/Users/bigagli/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
urls[22] = file:/Users/bigagli/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
urls[23] = file:/Users/bigagli/.m2/repository/org/mortbay/jetty/jetty/6.1.5/jetty-6.1.5.jar
urls[24] = file:/Users/bigagli/.m2/repository/org/mortbay/jetty/jetty-util/6.1.5/jetty-util-6.1.5.jar
urls[25] = file:/Users/bigagli/.m2/repository/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:/Users/bigagli/maven/lib/maven-2.2.1-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.ExceptionInInitializerError
	at org.apache.webdav.lib.WebdavSession.getSessionInstance(WebdavSession.java:145)
	at org.apache.webdav.lib.WebdavSession.getSessionInstance(WebdavSession.java:127)
	at org.apache.webdav.lib.WebdavResource.setClient(WebdavResource.java:1273)
	at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1298)
	at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1320)
	at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1408)
	at org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:290)
	at org.apache.maven.wagon.providers.webdav.CorrectedWebdavResource.<init>(CorrectedWebdavResource.java:54)
	at org.apache.maven.wagon.providers.webdav.WebDavWagon.openConnection(WebDavWagon.java:143)
	at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
	at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:142)
	at org.apache.maven.plugins.site.SiteDeployMojo.execute(SiteDeployMojo.java:212)
	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.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
	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: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))
	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
	at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
	at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:69)
	... 31 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
	at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
	... 35 more
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
	at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
	... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19 seconds
[INFO] Finished at: Thu Jan 21 11:52:58 CET 2010
[INFO] Final Memory: 31M/264M
[INFO] ------------------------------------------------------------------------

Issue Links

Activity

Hide
Anthony Whitford added a comment -

The root issue may be related to doxia, because we think we can work around this bug doing something like:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <inputEncoding>UTF-8</inputEncoding>
        <outputEncoding>UTF-8</outputEncoding>
    </configuration>
    <!-- Need to exclude commons-logging due to bug.
         See:  http://jira.codehaus.org/browse/MSITE-459 -->
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-xhtml</artifactId>
            <version>1.1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>
Show
Anthony Whitford added a comment - The root issue may be related to doxia, because we think we can work around this bug doing something like:
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <inputEncoding>UTF-8</inputEncoding>
        <outputEncoding>UTF-8</outputEncoding>
    </configuration>
    <!-- Need to exclude commons-logging due to bug.
         See:  http://jira.codehaus.org/browse/MSITE-459 -->
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-xhtml</artifactId>
            <version>1.1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>
Hide
Dennis Lundberg added a comment -

Anthony is on the right track here. doxia-core (a dependency of doxia-module-xhtml) uses commons-httpclient-3.1 which in turn uses commons-logging-1.0.4. This should in my opinion be fixed in Doxia instead.

Show
Dennis Lundberg added a comment - Anthony is on the right track here. doxia-core (a dependency of doxia-module-xhtml) uses commons-httpclient-3.1 which in turn uses commons-logging-1.0.4. This should in my opinion be fixed in Doxia instead.
Hide
redfish4ktc added a comment -

I also get the same error with goal site:site and site:stage.
The Anthony's workaround also fixes the problem.

Show
redfish4ktc added a comment - I also get the same error with goal site:site and site:stage. The Anthony's workaround also fixes the problem.
Hide
Dennis Lundberg added a comment -

redfish4ktc,
Are you sure that you are getting the same error with 'mvn site:site' or 'mvn site:stage' ?
If so, can you please attach your POM and post your stack trace here.

Show
Dennis Lundberg added a comment - redfish4ktc, Are you sure that you are getting the same error with 'mvn site:site' or 'mvn site:stage' ? If so, can you please attach your POM and post your stack trace here.
Hide
Dennis Lundberg added a comment -

The root cause of all this can be found in WAGON-60, and it should only affect people who use webdav for deployment.

A fix for WAGON-60 has been committed and deployed, but is not yet released.

Please test this fix by adding (or replacing) the build extension in your POM with this:

<build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>1.0-beta-7-SNAPSHOT</version>
      </extension>
    </extensions>
    ...
  </build>
Show
Dennis Lundberg added a comment - The root cause of all this can be found in WAGON-60, and it should only affect people who use webdav for deployment. A fix for WAGON-60 has been committed and deployed, but is not yet released. Please test this fix by adding (or replacing) the build extension in your POM with this:
<build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>1.0-beta-7-SNAPSHOT</version>
      </extension>
    </extensions>
    ...
  </build>
Hide
Dennis Lundberg added a comment -

Lorenzo and Anthony,
have you tested the fix I suggested on your builds?
If not, then please do - we need verification that the fix works before we can release it.

Show
Dennis Lundberg added a comment - Lorenzo and Anthony, have you tested the fix I suggested on your builds? If not, then please do - we need verification that the fix works before we can release it.
Hide
redfish4ktc added a comment -

Dennis,
While upgrading from maven-site 2.0 to 2.1, i get a "More than one version of 'org.apache.commons.logging.Log' visible in the classpath" error but with a different exception stack trace.

In fact, my problem was due to MJAVADOC-246 and i fix it by upgrading the maven-javadoc-plugin to the 2.7 version.
Sorry for disturbing

Show
redfish4ktc added a comment - Dennis, While upgrading from maven-site 2.0 to 2.1, i get a "More than one version of 'org.apache.commons.logging.Log' visible in the classpath" error but with a different exception stack trace. In fact, my problem was due to MJAVADOC-246 and i fix it by upgrading the maven-javadoc-plugin to the 2.7 version. Sorry for disturbing
Hide
Benson Margulies added a comment -

I've run into this with the cobertura-maven-plugin project.

It uses

<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>

and 2.2 of the site plugin, and gets the backtrace above, more or less.

I could back up the site plugin, but is there some other way of managing the dependency?

Show
Benson Margulies added a comment - I've run into this with the cobertura-maven-plugin project. It uses <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav</artifactId> <version>1.0-beta-2</version> </extension> and 2.2 of the site plugin, and gets the backtrace above, more or less. I could back up the site plugin, but is there some other way of managing the dependency?
Hide
Benson Margulies added a comment -

Never mind, I understand the workaround now.

Show
Benson Margulies added a comment - Never mind, I understand the workaround now.

People

Vote (5)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: