[ 
https://issues.apache.org/jira/browse/VFS-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13844697#comment-13844697
 ] 

Robbie Haertel commented on VFS-505:
------------------------------------

Gary,

I'm encountering problems with the HEAD of trunk. In the interest of full 
disclosure, I've never used Maven before. When I run mvn install, several of 
the tests fail. So I I'm forced to use mvn -Dmaven.test.skip=true install 
instead. I copy the commons-vfs2-2.1-SNAPSHOT.jar from the Maven repository to 
my Eclipse project and update the build path (remove the old .jar, add this new 
one). Now I get a different exception; it doesn't seem to be recognizing the 
.tar loader:

Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Badly 
formed URI "tar:file://Users/rhaertel/git/statnlp/newsgroups.tar".
        at 
org.apache.commons.vfs2.provider.url.UrlFileProvider.findFile(UrlFileProvider.java:90)
        at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:719)
        at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:656)
        at 
org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:609)
        at 
edu.byu.nlp.pipes.docs.DocumentDatasetBuilder.<init>(DocumentDatasetBuilder.java:82)
        at edu.byu.nlp.al.txt.LearningCurve.readData(LearningCurve.java:480)
        at edu.byu.nlp.al.txt.LearningCurve.run(LearningCurve.java:245)
        at edu.byu.nlp.al.txt.FSLLearningCurve.main(FSLLearningCurve.java:60)
Caused by: java.net.MalformedURLException: unknown protocol: tar
        at java.net.URL.<init>(URL.java:590)
        at java.net.URL.<init>(URL.java:480)
        at java.net.URL.<init>(URL.java:429)
        at 
org.apache.commons.vfs2.provider.url.UrlFileProvider.findFile(UrlFileProvider.java:71)
        ... 7 more

> Reading from an input stream in a .tar ends up with a 'reading from an output 
> buffer' exception
> -----------------------------------------------------------------------------------------------
>
>                 Key: VFS-505
>                 URL: https://issues.apache.org/jira/browse/VFS-505
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Robbie Haertel
>
> This is probably the same issue as 
> https://issues.apache.org/jira/browse/VFS-350, but for version 2.0 and for 
> the .tar reader.
> The problem: After successfully reading some files from the .tar, I 
> unexpectedly get:
> {noformat}
> 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)
> {noformat}
> Note that I have several read-only streams open on the same .tar file. The 
> are being read on the same thread, but reads to different files are 
> interleaved. Even more interesting is that the same code path works fine when 
> only reading a small subset of the data (this, too, includes interleaving 
> reads to different files in the same .tar file). It may be a function of the 
> number of bytes read.
> Note that I do NOT have any files open for writing.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to