[
https://issues.apache.org/jira/browse/VFS-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13833032#comment-13833032
]
Robbie Haertel commented on VFS-350:
------------------------------------
I'm encountering a similar issue in version 2.0 for a plain .tar file. I am
concurrently reading multiple files from the same .tar file. Curiously, the
same code works in some cases, and not others and I believe it is a function of
the number of bytes read (fewer bytes complete successful, even in the face of
concurrent reads from the same .tar file).
Here is the stack trace:
Caused by: java.io.IOException: reading from an output buffer
at
org.apache.commons.vfs2.provider.tar.TarBuffer.readRecord(TarBuffer.java:211)
at
org.apache.commons.vfs2.provider.tar.TarInputStream.read(TarInputStream.java:384)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at
org.apache.commons.vfs2.util.MonitorInputStream.read(MonitorInputStream.java:100)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at com.google.common.io.LineReader.readLine(LineReader.java:76)
at
edu.byu.nlp.io.LineReaderIterator.readLineQuietly(LineReaderIterator.java:31)
... 19 more
> Reading from an input stream to a .tar.gz ends up with a 'reading from an
> output buffer' exception
> --------------------------------------------------------------------------------------------------
>
> Key: VFS-350
> URL: https://issues.apache.org/jira/browse/VFS-350
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 1.0
> Reporter: Benson Margulies
>
> I can turn this into a test case if needed.
> A source snippet:
> {noformat}
> FileObject annotations = root.getChild("annotations");
> FileContent annotationsContent = annotations.getContent();
> InputStream input = annotationsContent.getInputStream();
> InputStreamReader isr = new InputStreamReader(input,
> Charset.forName("utf-8"));
> BufferedReader lineReader = new BufferedReader(isr);
> String line;
> while ((line = lineReader.readLine()) != null) {
> }
> java.io.IOException: reading from an output buffer
> at
> org.apache.commons.vfs.provider.tar.TarBuffer.readRecord(TarBuffer.java:213)
> at
> org.apache.commons.vfs.provider.tar.TarInputStream.read(TarInputStream.java:386)
> at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
> at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
> at
> org.apache.commons.vfs.util.MonitorInputStream.read(MonitorInputStream.java:74)
> at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
> at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
> at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
> at java.io.InputStreamReader.read(InputStreamReader.java:167)
> at java.io.BufferedReader.fill(BufferedReader.java:136)
> at java.io.BufferedReader.readLine(BufferedReader.java:299)
> at java.io.BufferedReader.readLine(BufferedReader.java:362)
> at com.basistech.lsh.utils.TdtTestData.<init>(TdtTestData.java:130)
> at
> com.basistech.lsh.utils.TdtTestDataTest.testTestDataReader(TdtTestDataTest.java:36)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1#6144)