دنبال کننده ها

۱۳۹۷ فروردین ۲۱, سه‌شنبه

google app engine - NullPointerException on saving file with CreateOrReplace method

[ad_1]



I'm trying to figure out where the error lies but with logs it's almost impossible to pinpoint the problem. Any ideas?



String unique = UUID.randomUUID().toString();
String fileName = unique + ".jpeg";
GcsFilename gcsFilename = new GcsFilename(MY_BUCKET_NAME, fileName);
try
GcsOutputChannel outputChannel = GcsServiceFactory.createGcsService().createOrReplace(gcsFilename, GcsFileOptions.getDefaultInstance());
copy(file.getInputStream(), Channels.newOutputStream(outputChannel));
catch (IOException e)
e.printStackTrace();



On GcsServiceFactory.createGcsService().createOrReplace() method, I'm constantly getting the



c.g.a.tools.cloudstorage.RetryHelper : RetryHelper(1.386 s, x attempts, com.google.appengine.tools.cloudstorage.GcsServiceImpl$1@6bd1dbe9): Attempt #x failed [java.io.IOException: java.lang.NullPointerException], sleeping for x ms


Thanks in advance!




[ad_2]

لینک منبع