gradle-aws-s3-sync
gradle-aws-s3-sync copied to clipboard
Invalid class name: ConnManagerFactory?
When I try to upload to my S3 bucket, I receive this:
org.jets3t.apps.synchronize.SynchronizeException: Unable to create or access bucket: my-bucket-name
(I made the bucket public write to make sure it's not a permissions issue.)
When I dig into the stack trace, there is this exception:
Invalid class name: org.jets3t.service.utils.RestUtils$ConnManagerFactory
When I seach for this class, it is nowhere called.
When I look at the referenced jets3t library, that class never existed in history.
Any idea what's wrong?
i've pulled master and compiled and i get this error too...
It may be related to the issue ( http://stackoverflow.com/questions/10144188/jets3t-connects-without-exception-but-invalid-class-name-when-i-try-to-do-a ). But I have not been able to reproduce the problem so far. Can you tell me about your environment information?(OS, Gradle version, JVM version, .etc.)
I'm having the same Issue.
- OS: Ubuntu 14.04
- Gradle version: 2.3
- Java version : 1.8.0_72
OS: Mac 10.11.3 Gradle version: 2.10 Java version : 1.7.0_80
I am able to reproduce this when my Gradle project has a 'buildSrc' project with the following dependency:
dependencies {
compile "org.codehaus.groovy.modules.http-builder:http-builder:0.7.2"
}
I changed my code to use reflection to load RESTClient
and removed this dependency and it's working. Note that if I put this dependency in the root project build.gradle
I don't have the same issues.
Same problem.
I was using this plugin in a different project and it was working fine, then ported the code across to my current project and it started failing.
Noticed when debug logging was on that jets3t was version 0.9.3, tried to "force" 0.9.4 by adding it to the buildscript classpath. The "forcing" worked, the debug log said 0.9.4 was being used - but same error.
Saw the comment from @double16, decided to just make a completely separate gradle project (not a sub-project/module) and that works. Not much of a workaround though, I lose the dependency to my build tasks.
Looks like project is not maintained any more? This makes gradle-aws-s3-sync pretty scary to rely on - you never know when it's going to break because some other dependency was upgraded/added.
@double16 @shorn Thank you very much for the information. I could reproduce the issue. The issue ( https://issues.apache.org/jira/browse/HTTPCLIENT-1727 ) may cause the problem.
Could you add the dependency to your build script path?
compile "org.apache.httpcomponents:httpclient:4.5.3"
I haven't had time to maintain the project. Maybe I will not update the project so often.
@literalice
Yep - that works for me.
Two things for any one else trying to use this fix:
I use the plugin in my actual gradle buildscript itself, so "compile" is not a valid configuration in the buildscript section, it needs to say:
classpath "org.apache.httpcomponents:httpclient:4.5.3"
And for anyone that is doing this in a multi-project build, because of gradle-wierdness that I don't really understand: this override line needs to to be in gradle.build buildscript section file of the root project.
If you're using gradle-aws-s3-sync in a sub-project of a multi-project build, defining this classpath override down in the project where you're using the plugin will likely not work - you'll still likely get the version of httpclient from whatever else is using httpclient in your build.
.
I haven't had time to maintain the project. Maybe I will not update the project so often.
No worries about that - thank you for your effort until now. It's a good project and I've gotten good use out of it.
If you decide to not support the plugin any more - please consider adding a statement about that to the readme. It will help people deciding whether to use it on a large project and maybe encourage someone to pick up the project. Thanks again!
I can confirm @shorn workaround does work :) It would be great if this wasn't necessary as I wasted quite a bit of time before finding this page.