java.lang.ClassCastException: org.archive.io.warc.WARCReaderFactory$UncompressedWARCReader cannot be cast to org.archive.io.warc.v10.WARCReader

JIRA | Michael Stack | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    The below was reported by Olaf Freyer up on the mailing list: With the release candidate I seem to be unable to use the v10 WARCReader via the console (not tested if it would fail when using via java, too). Here is how I'm used to use the WARCReader (updated to new package structure) My warcreader shell script basically contains: FOREGROUND='true' CLASS_MAIN='org.archive.io.warc.v10.WARCReader' JMX_OFF='off' $HERITRIX_HOME/bin/heritrix Now I do call: sh warcreader -f dump myWARC.warc Here is what I get: java.lang.ClassCastException: org.archive.io.warc.WARCReaderFactory$UncompressedWARCReader cannot be cast to org.archive.io.warc.v10.WARCReader at org.archive.io.warc.v10.WARCReaderFactory.get(WARCReaderFactory.java:61) at org.archive.io.warc.v10.WARCReader.main(WARCReader.java:298) Also note that I seem to be unable to use the "dump" option of the WARCReader of heritrix-1.10.2, too. Even though it at least starts up I get the following error: Exception processing myWARC.warc: java.io.IOException: Unexpected character a(Expecting d) java.lang.RuntimeException: java.io.IOException: Unexpected character a(Expecting d) at org.archive.io.ArchiveReader$ArchiveRecordIterator.hasNext(ArchiveReader.java:462) at org.archive.io.warc.WARCReader.dump(WARCReader.java:104) at org.archive.io.ArchiveReader.output(ArchiveReader.java:627) at org.archive.io.warc.WARCReader.output(WARCReader.java:156) at org.archive.io.warc.WARCReader.main(WARCReader.java:300) Caused by: java.io.IOException: Unexpected character a(Expecting d) at org.archive.io.warc.WARCReader.readExpectedChar(WARCReader.java:81) at org.archive.io.warc.WARCReader.gotoEOR(WARCReader.java:71) at org.archive.io.ArchiveReader.cleanupCurrentRecord(ArchiveReader.java:190) at org.archive.io.ArchiveReader$ArchiveRecordIterator.hasNext(ArchiveReader.java:460) ... 4 more Thanks in advance for any help/advice Olaf freyer

    JIRA | 1 decade ago | Michael Stack
    java.lang.ClassCastException: org.archive.io.warc.WARCReaderFactory$UncompressedWARCReader cannot be cast to org.archive.io.warc.v10.WARCReader

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.archive.io.warc.WARCReaderFactory$UncompressedWARCReader cannot be cast to org.archive.io.warc.v10.WARCReader

      at org.archive.io.warc.v10.WARCReaderFactory.get()
    2. org.archive.io
      WARCReader.main
      1. org.archive.io.warc.v10.WARCReaderFactory.get(WARCReaderFactory.java:61)
      2. org.archive.io.warc.v10.WARCReader.main(WARCReader.java:298)
      2 frames