Skip to main content

Exception in update API call

Comments

4 comments

  • Ido

    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
  • Pedro Pascoal

    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
  • Roee Ben Ari

    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
  • Pedro Pascoal

    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 attention

    0

Post is closed for comments.