Issue Details (XML | Word | Printable)

Key: MOJO-1101
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: David Vicente
Reporter: Duncan Doyle
Votes: 6
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Mojo

Dashboard plugin gives error in Maven 2.0.9 on commons-logging

Created: 22/Apr/08 04:11 AM   Updated: 30/Oct/08 01:29 PM
Component/s: dashboard
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Windows XP, Linux , SUN & IBM 1.4.2 JVMs
Issue Links:
Duplicate
 

Complexity: Intermediate


 Description  « Hide
With the new Maven 2.0.9 the Dashboard plugin throws the following exception.

[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.codehaus.mojo.dashboard.report.plugin.hibernate.HibernateServiceImpl.initialize(HibernateServiceImpl.java:116)
at org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializePhase.execute(InitializePhase.java(Compiled Code))
at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java(Compiled Code))
at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java(Compiled Code))
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java(Inlined Compiled Code))
at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java(Compiled Code))
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java(Compiled Code))
at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java(Compiled Code))
at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java(Inlined Compiled Code))
at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java(Compiled Code))
at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java(Compiled Code))
at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java(Compiled Code))
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java(Compiled Code))
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java(Compiled Code))
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:609)
at org.apache.maven.plugin.DefaultPluginManager.getReport(DefaultPluginManager.java:542)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getReports(DefaultLifecycleExecutor.java:711)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getReports(DefaultLifecycleExecutor.java:661)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:536)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
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.LogConfigurationExce
ption: 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.common
s.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 mo
re 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.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
... 40 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 loa
der 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)
... 44 more
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' v
isible, which is not allowed.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
... 45 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32 seconds
[INFO] Finished at: Tue Apr 22 11:01:43 CEST 2008
[INFO] Final Memory: 41M/69M
[INFO] ------------------------------------------------------------------------

This issue might be due to this change in Maven, although I haven't investigated this fully:

MNG-1412 / MNG-3111 introduced deterministic ordering of dependencies on the classpath. In the past, natural set ordering was used and this lead to odd results. The ordering is now preserved from your pom, with dependencies added by inheritence added last. In builds that had conflicting or duplicate dependencies, this may introduce a change to the output. In short, if you have weird issues with 2.0.9, take a look at the dependencies to see if you have conflicts somewhere.

This issue can be fixed by excluding the transitive commons-logging (1.0.4) dependency from the hibernate dependency and introducing a new dependency on commons-logging 1.1. I however don't exactly know why this works. This exception looks like there are 2 conflicting commons-logging JARs on the classpath, however, when I exclude the commons-logging from hibernate, there is no commons-logging jar at all on the classpath (NoClassDefFoundError). So it seems that there is only one commons-logging JAR included via a transitive dependency, so I don't understand where this error comes from.

This error does not occur in Maven 2.0.7 though.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Vicente added a comment - 22/Apr/08 07:45 AM
Hi Duncan,

could you post your pom.xml as attachment because i can't reproduce your error ?

I make a test with Maven 2.0.9, the only thrown error is a classNotFound with org/w3c/dom/DomError.

Best regards

David


Duncan Doyle added a comment - 22/Apr/08 08:08 AM
Hello David,

Well, I must say that I adjusted your POM a bit to get it to work with my config and repos (I adjusted the Dashboard parent POM (because it references a SNAPSHOT POM) and the JDepend dependency to reference my internal repo version of JDepend (which is basically the repackaged SNAPSHOT version)) because we don't allow SNAPSHOTS in our Archiva REPO.

I have to do some testing at home and give you a POM which reproduces the error. I'll try to do that tonight at home.

Kind regards,

Duncan


Maksim Kaszynski added a comment - 30/Apr/08 06:38 AM
we have have the same issue with maven 2.0.9
This is really a showstopper for us because we have two opportunities here
a) stick to mvn 2.07
b) not use dashboard plugin

IMO something changed in maven dependency management that duplicate dependencies occur and conflict.

http://anonsvn.jboss.org/repos/richfaces/trunk/

Here you can see all our poms.


David Vicente added a comment - 30/Apr/08 07:45 AM
Hi all,

i've read this article : http://blogs.sonatype.com/brian/2008/04/23/1208965980000.html

Could you make a test with this configuration in the <build> section

<!-- Dashboard -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dashboard-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<dialect>${org.hibernate.dialect}</dialect>
<driverClass>${org.hibernate.connection.driverclass}</driverClass>
<connectionUrl>${org.hibernate.connection.connectionurl}</connectionUrl>
<username>${org.hibernate.connection.username}</username>
<password>${org.hibernate.connection.password}</password>
<keepVersionAsDiscriminantCriteria>false</keepVersionAsDiscriminantCriteria>

</configuration>
<dependencies>
<dependency>
<!-- HSQLDB Jdbc Driver -->
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.9</version>
</dependency>
<dependency>
<!-- to override commons-logging in Hibernate library dependancy -->
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</plugin>

keep me in touch

Best regards

David


Maksim Kaszynski added a comment - 30/Apr/08 10:44 AM - edited
David,
Your work-around does work.
Thank you

David Vicente added a comment - 05/May/08 03:31 AM
I'll write an entry in the FAQ file for this problem

David Vicente added a comment - 25/Jun/08 10:44 AM
deployed the 2008-06-25 as 1.0-SNAPSHOT