Skip to content

NoSuchMethodException in WarcResource class #145

@scheylord

Description

@scheylord

Hello,

When we launch openwayback (version 2.0.0.BETA.3) with CDX indexes from WARC files, we have a NoSuchMethodException in WarcResource class, which can't find getContentLength() method from ArchiveRecordHeader (webarchive-commons-1.1.3.jar)

A simple fix could be to remplace in the WarcResource class, line 156 rec.getHeader().getContentLength() by rec.getHeader().getLength() :

@@ -156,7 +156,7 @@ public class WarcResource extends Resource {
@OverRide
public long getRecordLength() {
if ((length == 0) && (rec.getHeader() != null)) {

  •                   length = rec.getHeader().getContentLength();
    
  •                   length = rec.getHeader().getLength();
            }
            return length;
    }
    

This is what we've done locally and it seems to work correctly.

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions