[GRADLE-729] java.lang.VerifyError with upload to WebDAV repository Created: 06/Nov/09  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.8
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Jurgen Lust Assignee: Hans Dockter
Resolution: Fixed Votes: 0


 Description   

I'm trying to upload an artifact to a Maven repository, using WebDAV. I'm using wagon-webdav-1.0-beta-2.

The uploadArtifacts section of my build file looks like this:

uploadArchives {
repositories.mavenDeployer {
name = 'googleCodeDeployer'
configuration = configurations.mavenDeploy
repository(url: "dav:https://bzb-framework.googlecode.com/svn/maven-repository/")

{ authentication(userName: "my.name", password: "mypassword") }

}
}

Now, when I run 'gradle upload -s', I get the following stacktrace:

org.gradle.api.GradleScriptException: Build file '/Users/jlust/Projecten/BeeWorks/meiji-framework/trunk/gradle/hibernate-tools/build.gradle'
Execution failed for task ':uploadArchives'.
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:232)
at org.gradle.execution.DefaultTaskExecuter.executeTask(DefaultTaskExecuter.java:165)
at org.gradle.execution.DefaultTaskExecuter.doExecute(DefaultTaskExecuter.java:156)
at org.gradle.execution.DefaultTaskExecuter.execute(DefaultTaskExecuter.java:74)
at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:174)
at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
at org.gradle.GradleLauncher.doBuildStages(GradleLauncher.java:165)
at org.gradle.GradleLauncher.doBuild(GradleLauncher.java:124)
at org.gradle.GradleLauncher.run(GradleLauncher.java:95)
at org.gradle.Main.execute(Main.java:100)
at org.gradle.Main.main(Main.java:43)
at org.gradle.BootstrapMain.main(BootstrapMain.java:50)
Caused by: org.gradle.api.GradleException: Could not publish configurations [configuration 'archives'].
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:44)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.publish(DefaultConfiguration.java:194)
at org.gradle.api.tasks.Upload.upload(Upload.java:57)
at org.gradle.api.DefaultTask.invokeMethod(DefaultTask.groovy)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:125)
at org.gradle.api.internal.project.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:123)
at org.gradle.api.internal.AbstractTask.doExecute(AbstractTask.java:257)
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:222)
... 11 common frames omitted
Caused by: org.apache.tools.ant.BuildException: Error deploying artifact 'org.meijiframework.gradle:gradle-hibernate-tools:jar': Error retrieving previous build number for artifact 'org.meijiframework.gradle:gradle-hibernate-tools:jar': repository metadata for: 'snapshot org.meijiframework.gradle:gradle-hibernate-tools:1.0.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:138)
at org.gradle.api.internal.artifacts.publish.maven.deploy.CustomDeployTask.doExecute(CustomDeployTask.java:42)
at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:665)
at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.execute(AbstractMavenResolver.java:186)
at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.commitPublishTransaction(AbstractMavenResolver.java:178)
at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:263)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:62)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.publish(DefaultIvyService.java:127)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.publish(ShortcircuitEmptyConfigsIvyService.java:61)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:42)
... 19 common frames omitted
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error retrieving previous build number for artifact 'org.meijiframework.gradle:gradle-hibernate-tools:jar': repository metadata for: 'snapshot org.meijiframework.gradle:gradle-hibernate-tools:1.0.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:106)
at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransformationManager.java:78)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:71)
at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:117)
... 28 common frames omitted
Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException: repository metadata for: 'snapshot org.meijiframework.gradle:gradle-hibernate-tools:1.0.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:352)
at org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java:161)
at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:100)
... 31 common frames omitted
Caused by: org.apache.maven.wagon.TransferFailedException: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:404)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadataFromDeploymentRepository(DefaultWagonManager.java:379)
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.getArtifactMetadataFromDeploymentRepository(DefaultRepositoryMetadataManager.java:380)
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:348)
... 33 common frames omitted
Caused by: org.apache.maven.wagon.UnsupportedProtocolException: Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.artifact.manager.DefaultWagonManager.getWagon(DefaultWagonManager.java:135)
at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:398)
... 36 common frames omitted
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.wagon.Wagondav', it could not be created
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
at org.apache.maven.artifact.manager.DefaultWagonManager.getWagon(DefaultWagonManager.java:131)
... 37 common frames omitted
Caused by: org.codehaus.plexus.component.factory.ComponentInstantiationException: Could not instanciate component: role: 'org.apache.maven.wagon.Wagon', implementation: 'org.apache.maven.wagon.providers.webdav.WebDavWagon', role hint: 'dav'
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
... 39 common frames omitted
Caused by: java.lang.VerifyError: (class: org/apache/maven/wagon/providers/webdav/WebDavWagon, method: getFileList signature: (Ljava/lang/String;)Ljava/util/List Incompatible object argument for function call
at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)



 Comments   
Comment by Jurgen Lust [ 06/Nov/09 ]

Adam suggested the following on the mailing list:

This looks like a jar versioning problem. Could you try replacing
$gradleHome/lib/commons-httpclient-3.0.jar with
commons-httpclient-2.0.2.jar, and removing
$gradleHome/lib/webdavlib-2.0.jar, and see if it works.

This resolved the problem.

Comment by Russel Winder [ 15/Dec/09 ]

The priority of this issue needs raising to Blocker. Gradle should come with the right jars to be able to do this very critical function.

I tried the above hack and it doesn't work.

at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:64) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.tasks.DefaultTaskExecuter.execute(DefaultTaskExecuter.java:42) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.project.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:63) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:61) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:35) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:206) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:160) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.GradleLauncher.doBuildStages(GradleLauncher.java:199) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.GradleLauncher.doBuild(GradleLauncher.java:133) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.GradleLauncher.run(GradleLauncher.java:103) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.launcher.Main.execute(Main.java:93) [gradle-launcher-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.launcher.Main.main(Main.java:42) [gradle-launcher-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.launcher.GradleMain.main(GradleMain.java:51) [gradle-launcher-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
Caused by: org.gradle.api.GradleException: Could not publish configurations [configuration 'archives'].
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:44) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.publish(DefaultConfiguration.java:198) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.tasks.Upload.upload(Upload.java:57) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.DefaultTask.invokeMethod(DefaultTask.groovy) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:25) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.project.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:125) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.project.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:123) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:56) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
... 16 common frames omitted
Caused by: org.apache.tools.ant.BuildException: Error deploying artifact 'org.codehaus.gant:gant_groovy1.7:jar': Error retrieving previous build number for artifact 'org.codehaus.gant:gant_groovy1.7:jar': repository metadata for: 'snapshot org.codehaus.gant:gant_groovy1.7:1.9.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Error transferring file
at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:144) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.gradle.api.internal.artifacts.publish.maven.deploy.CustomDeployTask.doExecute(CustomDeployTask.java:42) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:678) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.execute(AbstractMavenResolver.java:195) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.commitPublishTransaction(AbstractMavenResolver.java:186) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:263) [ivy-2.1.0-rc2.jar:2.1.0-rc2]
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:54) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.publish(DefaultIvyService.java:144) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.publish(ShortcircuitEmptyConfigsIvyService.java:61) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:42) [gradle-core-0.9-20091215083156+0000.jar:0.9-20091215083156+0000]
... 23 common frames omitted
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error retrieving previous build number for artifact 'org.codehaus.gant:gant_groovy1.7:jar': repository metadata for: 'snapshot org.codehaus.gant:gant_groovy1.7:1.9.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Error transferring file
at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:106) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransformationManager.java:78) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:71) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:123) [maven-ant-tasks-2.0.10.jar:2.0.10]
... 32 common frames omitted
Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException: repository metadata for: 'snapshot org.codehaus.gant:gant_groovy1.7:1.9.0-SNAPSHOT' could not be retrieved from repository: remote due to an error: Error transferring file
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:352) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java:161) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:100) [maven-ant-tasks-2.0.10.jar:2.0.10]
... 35 common frames omitted
Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:104) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:68) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:475) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadataFromDeploymentRepository(DefaultWagonManager.java:380) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.getArtifactMetadataFromDeploymentRepository(DefaultRepositoryMetadataManager.java:380) [maven-ant-tasks-2.0.10.jar:2.0.10]
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:348) [maven-ant-tasks-2.0.10.jar:2.0.10]
... 37 common frames omitted
Caused by: java.net.ProtocolException: Server redirected too many times (20)
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83) [maven-ant-tasks-2.0.10.jar:2.0.10]
... 42 common frames omitted
15:28:41.311 [main] ERROR org.gradle.launcher.Main -

Comment by Russel Winder [ 15/Dec/09 ]

OK, I got it to work. The trick is not to remove anything it all works fine with Gradle trunk as at 2009-12-15-15:50+00:00. The problem has not been with the libraries but with hasProperty. It transpires that

hasProperty ( 'gant_repoUserName' )

returns null even though gant_repoUserName is set. So my problem was nothing to do with jars and versions but entirely to do with assumptions about the code that was put into the GPars build.gradle.

Comment by Russel Winder [ 15/Dec/09 ]

The above success is for Gant, there still seems to be a problem for GPars so there is still something amiss.

Comment by Russel Winder [ 15/Dec/09 ]

Removing commons-httpclient-3.0.jar and webdavlib-2.0.jar from $GRADLE_HOME/lib fixes the problem for GPars as well.

Comment by Hans Dockter [ 06/May/10 ]

Peter Ledbrook recommends to try out the following:

Perhaps the documentation should promote the use of
'org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-6' for Maven
deployment? This has the advantage that it works with HTTPClient 3.1
(and perhaps 3.0).
Comment by Hans Dockter [ 24/Jun/10 ]

Using the jackrabbit wagon lib solves the problem. I have updated the docs.

Generated at Wed Jun 30 11:37:20 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.