Problem on reading Blobs

43 views
Skip to first unread message

mr.dc

unread,
Aug 28, 2011, 10:25:47 AM8/28/11
to Google App Engine
Hello there ... i have a small problem reading blobs and i can't
figure out whats the problem.
So this is my part of the code (Java):

FileService fileService = FileServiceFactory.getFileService();
AppEngineFile file;
file = fileService.getBlobFile(bkey);
boolean lock = false;
FileReadChannel readChannel = null;

readChannel = fileService.openReadChannel(file, lock);

The error i get is a FileNotFoundException at the openReadChannel
function.
I checked the BlobKey (bkey) and that key exists(thats why getBlobFile
does not fail with that FileNotFoundException).
I tried many possible ways, but just can't read the blob-files i write
into the blobstore.
Although it seems to create the blob files in the "appengine-
generated" folder i have no luck at all to get the content of those
files.

The variable "bkey" gets loaded from an entry in a datastore(its kinda
like a foreign key ).
Not shure if that could create the problem but because
fileService.getBlobFile does not fail i think thats not the problem.

The problem appears online and localy ...

Btw:
Another problem happens at my online data viewer:
I'm not able to see any new records for some reason, although i can
read them through my application.

Hope somebody of you can help me.
(Sorry if there are still some writing-mistakes inside but english is
not my main language)

mr.dc

unread,
Aug 31, 2011, 5:01:48 AM8/31/11
to Google App Engine
Anybody knows if it matters when the blobsize is bigger than 1 mb?
Because my "files" are a bit bigger than 1 mb, thats why i write the
blob with openWriteChannel and a for-loop in batches.
(and it does not fail at writing, even the file is created in the
folder "appengine-generated" at the development-system seems to be
correct)

The stack-trace sadly does not help me at all (atleast not me ...
maybe someone else finds the problem in the appengine source):
java.io.FileNotFoundException
at
com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:
495)
at
com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:
479)
at
com.google.appengine.api.files.FileServiceImpl.open(FileServiceImpl.java:
412)
at
com.google.appengine.api.files.FileServiceImpl.openForRead(FileServiceImpl.java:
372)
at
com.google.appengine.api.files.FileServiceImpl.openForRead(FileServiceImpl.java:
363)
at
com.google.appengine.api.files.FileServiceImpl.openReadChannel(FileServiceImpl.java:
138)
...

As already said the file exists in my development-version, but sadly
tells me it doesn't read it with openReadChannel and just fails.
I guess thats why the blobstore is still "Experimental" for writing
files.

Maybe i have more luck with python?
But basically it should not matter on the programming language, or?
With python i would also loose alot of power of the gwt-framework :(
Reply all
Reply to author
Forward
0 new messages