Exception in update API call
Hi to everyone,
it's the first time I try Cloudinary and I would to upload an image and get url, using JAVA library.
Unfortunately I receive this Exception:
Exception in thread "main" java.lang.AbstractMethodError: com.cloudinary.strategies.AbstractUploaderStrategy.callApi(Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/lang/Object;Lcom/cloudinary/ProgressCallback;)Ljava/util/Map;
at com.cloudinary.Uploader.callApi(Uploader.java:34)
at com.cloudinary.Uploader.upload(Uploader.java:76)
at com.cloudinary.Uploader.upload(Uploader.java:68)
Had someone this issue? How I can resolve it?
Thanks to everyone in advance, Marco.
-
Hi.
Can you elaborate on what it is you are doing exactly?
How are you uploading?
Can you share a nipper of your code?
Looking forward to your reply.
0 -
Hi I have the same problem
I follow the start guide so this is what I have done:
Pom file:
Code:
So I'm doing the connection and try to send a sample image to cloud
Error:
java.lang.AbstractMethodError: com.cloudinary.strategies.AbstractUploaderStrategy.callApi(Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;Ljava/lang/Object;Lcom/cloudinary/ProgressCallback;)Ljava/util/Map;
Conclusion with this error I can't get the url but the upload it's allright.
Thanks to everyone in advance, Pedro.
0 -
Hi Pedro,
I see you are using different versions for taglib and http4 jars. We recommend using the same version for both the dependencies.
<dependency> <groupId>com.cloudinary</groupId> <artifactId>cloudinary-taglib</artifactId> <version>1.17.0</version> </dependency> <dependency> <groupId>com.cloudinary</groupId> <artifactId>cloudinary-http44</artifactId> <version>1.17.0</version> </dependency>
Here is a working upload image example. Please try it and let us know if it's working for you?
import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Map; import com.cloudinary.Cloudinary; import com.cloudinary.Transformation; import com.cloudinary.utils.ObjectUtils; public class UploadTest { public static void main(String[] args) throws IOException { Cloudinary cloudinary = new Cloudinary("cloudinary://<apikey>:<secret>@<cloudname>"); File toUpload = new File("/Users/Desktop/sample.jpg"); Map uploadResult = cloudinary.uploader().upload(toUpload, ObjectUtils.emptyMap()); System.out.println("uploadResult: "+uploadResult); } }
0 -
Hi Roee
Thank you for fast response.
I changed my dependency's and my connection like your suggest, and it's works perfectly.
Thank you for your attention0
Post is closed for comments.
Comments
4 comments