-
1. Re: Problem with reading binary stream from file
hchiorean Sep 19, 2013 8:34 AM (in response to m.jawwad)This might very well be a bug. Can you please open a JIRA issue for it and if possible attach your configuration ? Thanks.
-
2. Re: Problem with reading binary stream from file
hchiorean Sep 20, 2013 4:50 AM (in response to m.jawwad)I tested this locally using a unit test and everything worked fine (I tested also using your code and a ByteArrayOutputStream).
So please post your repository and Infinispan configurations. Thanks.
-
3. Re: Re: Problem with reading binary stream from file
m.jawwad Sep 20, 2013 5:49 AM (in response to hchiorean)Hi, I have attached both my config files. Also I am using ModeShape 3.4
Thanks.
-
DataRepository.json.zip 1.3 KB
-
configuration.xml 5.8 KB
-
-
4. Re: Problem with reading binary stream from file
hchiorean Sep 20, 2013 6:54 AM (in response to m.jawwad)Can you please test this with 3.5.0.Final and also with/without text extractors. Also, make sure the code that's storing the binary value in the first place calls session.save() so that the value is actually persisted.
I've opened a JIRA for this (see linked issue) but using the latest codebase from "master" I'm unable to reproduce it atm.
-
5. Re: Re: Problem with reading binary stream from file
hchiorean Sep 20, 2013 9:36 AM (in response to m.jawwad)I've opened https://github.com/ModeShape/modeshape/pull/953 which attempts to reproduce the issue, but without success. Please have a look at https://github.com/hchiorean/modeshape/blob/aaebd64e698c523cb9bd788bb4be193b236ab90d/modeshape-jcr/src/test/java/org/mod… and try to modify it in any way so that the issue is reproduced. Thanks.
-
6. Re: Re: Problem with reading binary stream from file
m.jawwad Sep 23, 2013 2:10 AM (in response to hchiorean)Hi, Thanks for the suggestions, i will try them and then report back. I have tried several times but my while loop terminates unexpectedly. After debugging the code,I found out that I am getting the binary stream from modeshape as it shows the correct size in bytes. but as soon as I try to write it onto the servlet output stream, it terminates unexpectedly.
int bit = 256;
byte[] buffer = new byte[4096];
while ((bit = is.read(buffer, 0, 4096)) != -1) { //code executes till here only,
outs.write(buffer, 0, bit); //this line never gets executed
}
Thanks.
-
7. Re: Re: Problem with reading binary stream from file
hchiorean Sep 24, 2013 3:52 AM (in response to m.jawwad)Since this is happening in a custom codebase, there's not much we can do about it. Please try to either use https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/test/java/org/modeshape/jcr/value/binary/BinaryStor… to create a reproducible test-case or provide us with a simple executable scenario that we can run locally. Thanks.
-
8. Re: Problem with reading binary stream from file
hchiorean Oct 11, 2013 8:00 AM (in response to hchiorean)For what it's worth, working on [MODE-1752] Improve skip(...) performance in InputStream of InfinispanBinaryStore - JBoss Issue Tracker exposed the fact that the skip implementation in ChunkInputStream is badly broken (and untested), so if your code relied on a sequence of skip & read operations it will not retrieve the correct data.