Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4360

[regression] wagon-webdav-jackrabbit doesn't work with Maven 3.x

    XMLWordPrintableJSON

    Details

      Description

      Olivier mentioned this before and I finally found a reproducible test case:

      [DEBUG] Failed to lookup a member of active collection with role: org.apache.maven.wagon.Wagon and role-hint: dav
      -----------------------------------------------------
      realm =    project>org.apache.maven.its.mng3599:test:1.0-SNAPSHOT
      strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      urls[0] = file:/it-repo/org/apache/maven/wagon/wagon-webdav-jackrabbit/1.0-beta-3/wagon-webdav-jackrabbit-1.0-beta-3.jar
      urls[1] = file:/it-repo/nekohtml/xercesMinimal/1.9.6.2/xercesMinimal-1.9.6.2.jar
      urls[2] = file:/it-repo/nekohtml/nekohtml/1.9.6.2/nekohtml-1.9.6.2.jar
      urls[3] = file:/it-repo/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
      urls[4] = file:/it-repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
      urls[5] = file:/it-repo/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
      urls[6] = file:/it-repo/org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.jar
      urls[7] = file:/it-repo/org/apache/jackrabbit/jackrabbit-webdav/1.4/jackrabbit-webdav-1.4.jar
      urls[8] = file:/it-repo/org/apache/jackrabbit/jackrabbit-jcr-commons/1.4/jackrabbit-jcr-commons-1.4.jar
      urls[9] = file:/it-repo/org/slf4j/slf4j-api/1.3.0/slf4j-api-1.3.0.jar
      urls[10] = file:/it-repo/org/slf4j/slf4j-nop/1.5.0/slf4j-nop-1.5.0.jar
      urls[11] = file:/it-repo/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
      urls[12] = file:/it-repo/it/could/webdav/0.4/webdav-0.4.jar
      urls[13] = file:/it-repo/org/mortbay/jetty/jetty/4.2.12/jetty-4.2.12.jar
      urls[14] = file:/it-repo/org/apache/maven/wagon/wagon-provider-test/1.0-beta-3/wagon-provider-test-1.0-beta-3.jar
      urls[15] = file:/it-repo/junit/junit/3.8.1/junit-3.8.1.jar
      urls[16] = file:/it-repo/easymock/easymock/1.2_Java1.3/easymock-1.2_Java1.3.jar
      Number of foreign imports: 4
      import: Entry[import org.codehaus.plexus.util.xml.pull.XmlSerializer from realm ClassRealm[plexus.core, parent: null]]
      import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParserException from realm ClassRealm[plexus.core, parent: null]]
      import: Entry[import org.codehaus.plexus.util.xml.pull.XmlPullParser from realm ClassRealm[plexus.core, parent: null]]
      import: Entry[import org.codehaus.plexus.util.xml.Xpp3Dom from realm ClassRealm[plexus.core, parent: null]]
      Number of parent imports: 20
      import: Entry[import org.codehaus.plexus.personality from realm null]
      import: Entry[import org.codehaus.plexus.logging from realm null]
      import: Entry[import org.codehaus.plexus.lifecycle from realm null]
      import: Entry[import org.codehaus.plexus.context from realm null]
      import: Entry[import org.codehaus.plexus.container from realm null]
      import: Entry[import org.codehaus.plexus.configuration from realm null]
      import: Entry[import org.codehaus.plexus.component from realm null]
      import: Entry[import org.codehaus.plexus.classworlds from realm null]
      import: Entry[import org.codehaus.plexus.PlexusContainerException from realm null]
      import: Entry[import org.codehaus.plexus.PlexusContainer from realm null]
      import: Entry[import org.codehaus.plexus.PlexusConstants from realm null]
      import: Entry[import org.codehaus.plexus.MutablePlexusContainer from realm null]
      import: Entry[import org.codehaus.plexus.DuplicateChildContainerException from realm null]
      import: Entry[import org.codehaus.plexus.DefaultPlexusContainer from realm null]
      import: Entry[import org.codehaus.plexus.DefaultContainerConfiguration from realm null]
      import: Entry[import org.codehaus.plexus.DefaultComponentRegistry from realm null]
      import: Entry[import org.codehaus.plexus.ContainerConfiguration from realm null]
      import: Entry[import org.codehaus.plexus.ComponentRegistry from realm null]
      import: Entry[import org.codehaus.classworlds from realm null]
      import: Entry[import org.apache.maven from realm null]
      
      realm =    plexus.core
      strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      urls[0] = file:/am/3.0/bin/../lib/commons-cli-1.2.jar
      urls[1] = file:/am/3.0/bin/../lib/google-collect-snapshot-20080530.jar
      urls[2] = file:/am/3.0/bin/../lib/maven-compat-3.0-SNAPSHOT.jar
      urls[3] = file:/am/3.0/bin/../lib/maven-core-3.0-SNAPSHOT.jar
      urls[4] = file:/am/3.0/bin/../lib/maven-embedder-3.0-SNAPSHOT.jar
      urls[5] = file:/am/3.0/bin/../lib/maven-model-3.0-SNAPSHOT.jar
      urls[6] = file:/am/3.0/bin/../lib/maven-model-builder-3.0-SNAPSHOT.jar
      urls[7] = file:/am/3.0/bin/../lib/maven-plugin-api-3.0-SNAPSHOT.jar
      urls[8] = file:/am/3.0/bin/../lib/nekohtml-1.9.6.2.jar
      urls[9] = file:/am/3.0/bin/../lib/plexus-cipher-1.4.jar
      urls[10] = file:/am/3.0/bin/../lib/plexus-component-annotations-1.2.1-SNAPSHOT.jar
      urls[11] = file:/am/3.0/bin/../lib/plexus-container-default-1.2.1-SNAPSHOT.jar
      urls[12] = file:/am/3.0/bin/../lib/plexus-interpolation-1.11.jar
      urls[13] = file:/am/3.0/bin/../lib/plexus-sec-dispatcher-1.3.jar
      urls[14] = file:/am/3.0/bin/../lib/plexus-utils-1.5.15.jar
      urls[15] = file:/am/3.0/bin/../lib/wagon-file-1.0-beta-6.jar
      urls[16] = file:/am/3.0/bin/../lib/wagon-http-lightweight-1.0-beta-6.jar
      urls[17] = file:/am/3.0/bin/../lib/wagon-http-shared-1.0-beta-6.jar
      urls[18] = file:/am/3.0/bin/../lib/wagon-provider-api-1.0-beta-6.jar
      urls[19] = file:/am/3.0/bin/../lib/xbean-reflect-3.4.jar
      urls[20] = file:/am/3.0/bin/../lib/xercesMinimal-1.9.6.2.jar
      Number of foreign imports: 0
      
      -----------------------------------------------------
      org.codehaus.plexus.component.repository.exception.ComponentLookupException:
      Unable to lookup component 'org.apache.maven.wagon.Wagon', it could not be started.
            role: org.apache.maven.wagon.Wagon
        roleHint: dav
      classRealm: project>org.apache.maven.its.mng3599:test:1.0-SNAPSHOT
      	at org.codehaus.plexus.DefaultComponentRegistry.getComponent(DefaultComponentRegistry.java:366)
      	at org.codehaus.plexus.DefaultComponentRegistry.lookup(DefaultComponentRegistry.java:178)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:394)
      	at org.codehaus.plexus.component.collections.AbstractComponentCollection.lookup(AbstractComponentCollection.java:141)
      	at org.codehaus.plexus.component.collections.ComponentMap.getComponentMap(ComponentMap.java:184)
      	at org.codehaus.plexus.component.collections.ComponentMap.getMap(ComponentMap.java:148)
      	at org.codehaus.plexus.component.collections.ComponentMap.get(ComponentMap.java:68)
      	at org.apache.maven.repository.legacy.DefaultWagonManager.getWagon(DefaultWagonManager.java:730)
      	at org.apache.maven.repository.legacy.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:280)
      	at org.apache.maven.repository.legacy.DefaultWagonManager.getArtifact(DefaultWagonManager.java:163)
      	at org.apache.maven.repository.legacy.DefaultWagonManager.getArtifact(DefaultWagonManager.java:178)
      	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:176)
      	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:515)
      	at org.apache.maven.repository.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:306)
      	at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:147)
      	at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:66)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.resolveProjectDependencies(DefaultLifecycleExecutor.java:379)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:312)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:199)
      	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:460)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:334)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:70)
      	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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: 
      Error constructing component role: 'org.apache.maven.wagon.Wagon', 
        implementation: 'org.apache.maven.wagon.providers.webdav.WebDavWagon', role hint: 'dav'
      	at org.codehaus.plexus.component.builder.XBeanComponentBuilder.createComponentInstance(XBeanComponentBuilder.java:178)
      	at org.codehaus.plexus.component.builder.XBeanComponentBuilder.build(XBeanComponentBuilder.java:123)
      	at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:181)
      	at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:51)
      	at org.codehaus.plexus.DefaultComponentRegistry.getComponent(DefaultComponentRegistry.java:351)
      	... 29 more
      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
      	at java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
      	at java.lang.Class.getConstructors(Class.java:1459)
      	at org.apache.xbean.recipe.ReflectionUtil.findConstructor(ReflectionUtil.java:527)
      	at org.apache.xbean.recipe.ObjectRecipe.findFactory(ObjectRecipe.java:532)
      	at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:270)
      	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
      	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
      	at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
      	at org.codehaus.plexus.component.builder.XBeanComponentBuilder.createComponentInstance(XBeanComponentBuilder.java:159)
      	... 33 more
      Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
      	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:225)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:211)
      	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      	... 43 more
      

      The cause of this is that the core filters out wagon-http-shared from the extension realm which causes AbstractHttpClientWagon to be loaded from the core but the core does not also provide commons-httpclient.

        Attachments

          Activity

            People

            • Assignee:
              bentmann Benjamin Bentmann
              Reporter:
              bentmann Benjamin Bentmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: