Invalid manifest file exception while using MergingStep

Issue #722 resolved
Former user created an issue

I am using Okapi API for my own Java application. I am trying to create XLIFF from a source XML document and merging back the translated XLIFF back to the source XML document.

The manifest file is succesfully created as follows :

<?xml version="1.0" encoding="UTF-8"?>
<!--=================================================================-->
<!--PLEASE, DO NOT RENAME, MOVE, MODIFY OR ALTER IN ANY WAY THIS FILE-->
<!--=================================================================-->
<manifest version="2" libVersion="0.35" projectId="P68C4186D" packageId="5d06fde1-9142-496f-a024-e8ca149a5800" source="en" target="fr" originalSubDir="original" skeletonSubDir="skeleton" sourceSubDir="work" targetSubDir="work" mergeSubDir="done" tmSubDir="" date="2018-05-24 17:24:25+0530" useApprovedOnly="0" updateApprovedFlag="0">
<creatorParameters>I3YxCmluY2x1ZGVDb2RlQXR0cnMuYj1mYWxzZQpwbGFjZWhvbGRlck1vZGUuYj10cnVlCmluY2x1ZGVOb1RyYW5zbGF0ZS5iPXRydWUKc2V0QXBwcm92ZWRBc05vVHJhbnNsYXRlLmI9ZmFsc2UKY29weVNvdXJjZS5iPXRydWUKaW5jbHVkZUFsdFRyYW5zLmI9dHJ1ZQppbmNsdWRlSXRzLmI9dHJ1ZQp1c2VTa2VsZXRvbi5iPWZhbHNl</creatorParameters>
<doc xml:space="preserve" docId="1" extractionType="xliff" relativeInputPath="revdoc.xml" filterId="okf_rainbowkit" inputEncoding="UTF-8" relativeTargetPath="/C:/testfolder3/" targetEncoding="UTF-8" selected="1">PD94bWwgdmVyc2lvbj0nMS4wJyA/Pgo8aXRzOnJ1bGVzIHZlcnNpb249JzEuMCcKIHhtbG5zOml0cz0naHR0cDovL3d3dy53My5vcmcvMjAwNS8xMS9pdHMnCiB4bWxuczp4bGluaz0naHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluaycKIHhtbG5zOml0c3g9J2h0dHA6Ly93d3cudzMub3JnLzIwMDgvMTIvaXRzLWV4dGVuc2lvbnMnCiB4bWxuczpva3A9J29rYXBpLWZyYW1ld29yazp4bWxmaWx0ZXItb3B0aW9ucycKPgo8IS0tIFNlZSBJVFMgc3BlY2lmaWNhdGlvbiBhdDogaHR0cDovL3d3dy53My5vcmcvVFIvaXRzLyAtLT4KPC9pdHM6cnVsZXM+Cg==</doc>
</manifest>

However, merging back the same package, API throws the following error : Exception in thread "main" net.sf.okapi.common.exceptions.OkapiException: Invalid manifest file. at net.sf.okapi.filters.rainbowkit.Manifest.load(Manifest.java:559) at net.sf.okapi.filters.rainbowkit.RainbowKitFilter.open(RainbowKitFilter.java:238) at net.sf.okapi.filters.rainbowkit.RainbowKitFilter.open(RainbowKitFilter.java:204) at net.sf.okapi.steps.rainbowkit.postprocess.Merger.startMerging(Merger.java:189) at net.sf.okapi.steps.rainbowkit.postprocess.MergingStep.handleStartDocument(MergingStep.java:132) at net.sf.okapi.steps.rainbowkit.postprocess.MergingStep.handleEvent(MergingStep.java:84) at net.sf.okapi.common.pipeline.Pipeline.execute(Pipeline.java:119) at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:231) at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:201) at net.sf.okapi.common.pipelinedriver.PipelineDriver.processBatch(PipelineDriver.java:182) at test.merge(test.java:140) at test.main(test.java:110)

Attached : Source Test Project Zip

Comments (3)

  1. Navpreet Singh

    Snippet for the merge code (already present in the source attachment)

    public void merge() {
            this.driver = new PipelineDriver();
            this.filter = new RainbowKitFilter();
            /*IMPORTANT : Please change the paths as per your folder structure*/
            driver.setRootDirectories("C:\\testfolder3", "C:\\testfolder3");
            //driver.setOutputDirectory("C:\\testfolder2\\outputs");
            IPipelineStep step1 = new RawDocumentToFilterEventsStep(this.filter);
            driver.addStep(step1);
    
            MergingStep step2 = new net.sf.okapi.steps.rainbowkit.postprocess.MergingStep();
            driver.addStep(step2);
            File source = new File("C:\\testfolder3\\pack1\\manifest.rkm");
            File target = new File("C:\\testfolder3\\target");
            this.bic = new BatchItemContext(source.toURI(), "UTF-8", "okf_rainbowkit@noPrompt", target.toURI(), "UTF-8", LocaleId.fromString("en"), LocaleId.fromString("fr"));
            driver.addBatchItem(this.bic);
            driver.setFilterConfigurationMapper(this.fcMapper);
            driver.processBatch();
            driver.clearSteps();
        }
    
  2. Navpreet Singh

    Issue resolved.

    The target provided during extraction step was incorrect.

    Kindly close this bug.

  3. Log in to comment