Hi All,
I am facing a strange problem when saving a file to jackrabbit!
I am passing a FileInputStream object to createBinary method of
ValueFactory as following:
session.getValueFactory().createBinary(inputStream);
I get the following exception:
java.io.IOException: Read error
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:199)
at
org.apache.jackrabbit.core.value.InternalValue.getBLOBFileValue(
InternalValue.java:594)
at org.apache.jackrabbit.core.value.InternalValue.createTemporary(
InternalValue.java:341)
at org.apache.jackrabbit.core.value.InternalValueFactory.create(
InternalValueFactory.java:92)
at org.apache.jackrabbit.core.value.ValueFactoryImpl.createBinary(
ValueFactoryImpl.java:74)
....
1. I checked if the given inputeStream is null, and it's not null!
2. I thought maybe the stream is already closed before to createBinary(),
so I commented out the line where I close the stream, didn't help!
3. I called inputStream.available() before calling createBinary(), then I
got the following error before the previous one:
12:34:03,150 INFO [STDOUT] inputStream: java.io.fileinputstr...@18288d2
12:34:03,150 ERROR [STDERR] java.io.IOException: The handle is invalid
12:34:03,166 ERROR [STDERR] at java.io.FileInputStream.available(
Native Method)
....
What is really strange is that everything used to work fine before, don't
know what happened to get that exception!!
I running JBoss 5.1.0, Spring 3.0.2.RELEASE, and jackrabbit 2.1.0.
Please, can anyone help me to solve this problem?
Thank you in advance.