简体   繁体   中英

java.lang.NoSuchMethodError: com.google.api.client.util.Strings.isNullOrEmpty

I am trying to upload the users profile Image in the Google Cloud Storage when i run my application in local It does not affect the oAuth flow and the image uploading is also fine. But when I deploy the same into Google App Engine Image uploading flow fails by throwing an Runtime exception java.lang.NoSuchMethodError: com.google.api.client.util.Strings.isNullOrEmpty

Here is my code

    private static GCSUpload gcs = null;
    public static synchronized GCSUpload instance() {
        if (gcs == null)
            gcs = new GCSUpload();
        return gcs;
    }

I included the following jars

google-api-client-1.4.1-beta google-api-client-1.5.0-beta

I also include other jar files needed. Removing google-api-client-1.4.1-beta jar fails the image uploading flow in local itself and removing google-api-client-1.5.0-beta jar fails oAuth flow in local itself adding these jar works properly in local but not in GAE Can anyone help me. Thanks in advance!.

How are you uploading your code? If you're using Eclipse, be wary of adding external libraries that don't "follow" your code when you deploy. Make sure all external jars you add are in WEB-INF/lib.

This was explained here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM