jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmed Elshereay <AElsher...@idc.com>
Subject IOException when setting a Binary property
Date Tue, 29 Jun 2010 10:55:05 GMT
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.FileInputStream@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. 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message