-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploading a file using a file or an inputstream doesn't seem to work. #22
Comments
Thanks for reporting this. |
Sorry I hit enter and created it before I had copied everything. =) |
This is the same as issue 15, but exercised a different way. In issue 15, they used: private final String NEW_LOCAL = "http://"+username+":"+password+"@localhost:8081/artifactory"; artifactory.repository(NEW_LOCAL).upload("libs-release-local/junit/junit/4.9/juni-4.9.jar", testFile).doUpload(); I used: private static final RepositoryHandle repository = af.repository("areese-ssh-proxy-test"); Which I would assume passes the username/pass in. |
the suggestion in issue 15 doesn't work:
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.ru |
Why do you embed the username the password and the url in the repository name and don't put the repository name itself? |
I tried that because of issue 15, which made me think that was a fix. It fails either way. I actually have to pass user/pass to the repository, because at some point I need to use Header based auth instead of user/path auth, but that's a different problem. |
Well, there is no chance it is going to work this way. The |
Yeah it doesn't work either way, see the first comment. :) package bugs; import java.io.File; import org.jfrog.artifactory.client.Artifactory; public class TestUpload { private static final RepositoryHandle repository = af public static void main(String[] args) throws Exception {
} } |
Did you look at the tests? I just ran them again and they are fine. |
The tests pass fine, but running it from a java app in eclipse it fails. |
If the tests are fine on your side, I'd suggest starting altering them towards your needs and see where they break. Then we'll have the cause and will be able to fix it. |
That's where I ran out of time. I copied the url from the tests to my java project, and it still failed, and I haven't had a chance to come back and figure out why it acts differently. |
NP, let me know your findings when you're back on it. |
We ended up writing a ning service provider for the api, and using that instead. |
package bugs;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import org.jfrog.artifactory.client.Artifactory;
import org.jfrog.artifactory.client.ArtifactoryClient;
import org.jfrog.artifactory.client.RepositoryHandle;
import org.jfrog.artifactory.client.UploadableArtifact;
public class TestUpload {
private static final Artifactory af = ArtifactoryClient.create(
"http://test.artifactory/artifactory/",
"areese",
"password");
}
File Upload output:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/ch/qos/logback/logback-classic/1.0.9/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.ru
ntime.GStringImpl, java.util.LinkedHashMap, java.io.BufferedInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Long) values: [/com/ya
hoo/dps/sshd/0.0.1-SNAPSHOT/package.txt, ...]
Possible solutions: wait(), any(), dump(), grep(), find()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
at groovy.lang.Closure.call(Closure.java:415)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:17421)
at org.codehaus.groovy.runtime.dgm$953.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:60)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:52)
at bugs.TestUpload.main(TestUpload.java:34)
InputStream upload output:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/ch/qos/logback/logback-classic/1.0.9/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.ru
ntime.GStringImpl, java.util.LinkedHashMap, java.io.FileInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Integer) values: [/com/yah
oo/dps/sshd/0.0.1-SNAPSHOT/package.txt, ...]
Possible solutions: wait(), any(), dump(), grep(), find()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
at groovy.lang.Closure.call(Closure.java:415)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:17421)
at org.codehaus.groovy.runtime.dgm$953.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:60)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:52)
at bugs.TestUpload.main(TestUpload.java:29)
The text was updated successfully, but these errors were encountered: