Menu

#2 Not able to ready an ICL file.

v1.0 (example)
open
None
5
2018-12-12
2014-03-07
No

Hi,

I'm using your library, I got an error reading an ICL file,

This is the info that I got from trying to read my first ICL file.. can you help !

10:34:25,678 INFO ReadSampleFile:60 - Entering application.
10:34:25,678 INFO ReadSampleFile:65 - 1.
10:34:25,678 INFO ReadSampleFile:66 - org.cdgsoftware.icl.reader.ICLReader@1ccce3c
10:34:25,678 WARN ICLFileRecordReader:203 - Error populating fields from byte array
org.cdgsoftware.icl.util.ICLException: Error setting: Standard Level
Field Validation Failed: Standard Level [30] did not pass validation check! data passed: [30]
at org.cdgsoftware.icl.field.Field.setFieldData(Field.java:287)
at org.cdgsoftware.icl.record.Record.populateFields(Record.java:237)
at org.cdgsoftware.icl.reader.ICLFileRecordReader.getNextRecord(ICLFileRecordReader.java:201)
at org.cdgsoftware.icl.reader.ICLFileRecordReader.read(ICLFileRecordReader.java:91)
at org.cdgsoftware.icl.reader.ICLReader.readICLFile(ICLReader.java:85)
at project1.ReadSampleFile.main(ReadSampleFile.java:67)
Error: org.cdgsoftware.icl.util.ICLException: Error setting: Standard Level
Field Validation Failed: Standard Level [30] did not pass validation check! data passed: [30]

This is my small code:
ICLFile theIclFile = new ICLFile();
FileControlRecord TheFileControlRecord = new FileControlRecord();
FileHeaderRecord TheFileHeaderRecord = new FileHeaderRecord();

    //theIclFile.setFileControl(TheFileControlRecord);
    theIclFile.setFileEncoding(FileEncoding.ASCII);
    //theIclFile.setFileHeader(TheFileHeaderRecord);

    try {
        logger.info("Entering application.");
        InStr = new FileInputStream("C://JDeveloper//mywork//X9SampleUsage//DESP21CDEC140217120001.X937");
        // Initialize theICLFileRecordReader which will parse the records in
        // the ICL file.
        ICLReader reader = new ICLReader(InStr);
        logger.info("1.");
        logger.info(reader.toString());
        theIclFile = reader.readICLFile();
        logger.info("2.");
        TheFileControlRecord = theIclFile.getFileControl();
        logger.info("3.");
        //logger.info(TheFileControlRecord.getRecordName());
    } catch (FileNotFoundException e) {
        System.out.println("Error filenot found: " + e.toString());
    } catch (IOException e) {
        System.out.println("Error: " + e.toString());
    } catch (ICLException e) {
        System.out.println("Error: " + e.toString());
    } finally {
        if (InStr != null) {
            // ensure to close the ICL file after the file is processed.

            try {
                InStr.close();
            } catch (IOException e) {
            }
        }
    }

Discussion

  • Jeff Gordy

    Jeff Gordy - 2014-03-07

    Hi,

    Your stack trace is showing the issue for this particular condition:

    org.cdgsoftware.icl.util.ICLException: Error setting: Standard Level
    Field Validation Failed: Standard Level [30] did not pass validation check! data passed: [30]

    So the field validator for the "Standard Level" is not accepting whatever is in your file. My recommendation is to go into the source code for the library and turn off any validators that are complaining until you get your file to properly read. Then you can selectively turn them back on if you feel that the entity providing the X9 file to you has bad data in a field and needs to fix it.

    Hope that helps,

    -Jeff

     
  • Ali Shah

    Ali Shah - 2016-11-18

    Hi Jeff,

    Can you share any code sample to create a new ICL, ECL or X937 file using your library? There isn't any sufficient documentation to create a new file? I'm stuck with this problem from 2 days. Can anybody help me ASAP? Thank you.

     
  • Jeff Gordy

    Jeff Gordy - 2016-11-18

    Hi Ali,

    Since you have spent a few days I'm sure that there are specific questions as opposed to general how to create a file, but to answer that one.

    You would build the cash letter records with their sub-records and fields as you need them and then create an ICLFile. Set the header, footer and the list of cash letter records in the ICLFile.

    Then you can call something like the following to write the file

                ICLFileWriter writer = new ICLFileWriter(myICLFile, new File("C://JDeveloper//mywork//X9SampleUsage//out.x9"));
                f.setFileEncoding(FileEncoding.ASCII);
                writer.writeFile();
    

    If that doesn't help feel free to ask more questions. I'll also update the jar file in the project as that has not been done in a long time and there are a few new records I have written to support some processing scenarios I have run into.

    -Jeff

     
  • Ali Shah

    Ali Shah - 2016-11-21

    Hi Jeff,
    Thanks for your response. Yes to be specific, i just need to input the check no, routing no, amount and generate an ICL file. Then what would be the process? is there any configuration that can be used as default to bypass the overhead of creating and updating cashletters, headers and controller records etc? I'm sharing my code that need your verification that i'm doing it in right way.

    String inst_routing_no="77820532083";
    String pb_routing_no="61000227";
    String pb_routing_no_cd="7";
    String amount="15.95";
    String seq_no="00043559";

            CheckDetailRecord check_detail = new CheckDetailRecord();
            check_detail.auxiliaryOnUs.setFieldData("");
            check_detail.externalProcessingCode.setFieldData("");
            check_detail.payorBankRoutingNumber.setFieldData(pb_routing_no);
            check_detail.payourBankRoutingNumberCheckDigit.setFieldData(pb_routing_no_cd);
            check_detail.itemAmount.setFieldData(amount);
            check_detail.eceInstitutionItemSequenceNumber.setFieldData(seq_no);
    
            ICLItem icl_item=new ICLItem();
            icl_item.setCheckDetail(check_detail);
    
            ArrayList<ICLItem> icl_itemList=new ArrayList<ICLItem>();
            icl_itemList.add(icl_item);
    
            BundleHeaderRecord bhr=new BundleHeaderRecord();
            bhr.collectionTypeIndicator.setFieldData("01");
            bhr.destinationRoutingNumber.setFieldData(pb_routing_no);
            bhr.eceInstitutionRoutingNumber.setFieldData(inst_routing_no);
            bhr.bundleSequenceNumber.setFieldData("1");
    
            BundleControlRecord bcr=new BundleControlRecord();
            bcr.itemCount.setFieldData("1");
            bcr.bundleAmount.setFieldData(amount);
            bcr.micrAmount.setFieldData(amount);
            bcr.imagesInBundleCount.setFieldData("0");
    
    
    
    
            ForwardPresentmentBundle fpb=new ForwardPresentmentBundle(bhr,icl_itemList,bcr);
            ArrayList<ForwardPresentmentBundle> fpb_list=new ArrayList<ForwardPresentmentBundle>();
            ArrayList<ReturnBundle> rb_list=new ArrayList<ReturnBundle>();
            fpb_list.add(fpb);
            CashLetterHeaderRecord clhr=new CashLetterHeaderRecord();
            clhr.destinationRoutingNumber.setFieldData(pb_routing_no);
            clhr.eceInstitutionRoutingNumber.setFieldData(inst_routing_no);
            clhr.cashLetterRecordTypeIndicator.setFieldData("E");
            clhr.cashLetterDocumentationTypeIndicator.setFieldData("C");
    
            CashLetterControlRecord clcr=new CashLetterControlRecord();
            CashLetter cl=new CashLetter(clhr,fpb_list,rb_list,clcr);
    
            File f=new File("sample/abcd.ICL");
            ICLFile theIclFile = new ICLFile();
            theIclFile.setFileEncoding(FileEncoding.ASCII);
    

    // theIclFile.setCashLetterList();

            System.out.println("Entering application.");
    
            ICLFileWriter writer = new ICLFileWriter(theIclFile,f);
            writer.writeFile();
    
     
  • Ali Shah

    Ali Shah - 2016-11-21

    here is my code to create an ICL file. Can you please guide me which things i'm doing wrong.
    1) When i pass 9 digit routing number it throws exception
    Payor Bank Routing Number is too long for type: Numeric data passed: [061000227] data passed: [061000227]

    2) when i pass 8 digit number it throws
    Routing Number [61000227] did not pass mod ten check! data passed: [61000227]

    Following is my code

    public class ICL_Create{

    public static void create_new(){
    try {
    String inst_routing_no="061000227";
    String pb_routing_no="061000227";
    // String pb_routing_no="12200024";
    String pb_routing_no_cd="7";
    String amount="15";
    String seq_no="00043559";

            CheckDetailRecord check_detail = new CheckDetailRecord();
            check_detail.auxiliaryOnUs.setFieldData("");
            check_detail.externalProcessingCode.setFieldData("");
            check_detail.payorBankRoutingNumber.setFieldData(pb_routing_no);
            check_detail.payourBankRoutingNumberCheckDigit.setFieldData(pb_routing_no_cd);
            check_detail.itemAmount.setFieldData(amount);
            check_detail.eceInstitutionItemSequenceNumber.setFieldData(seq_no);
    
            ICLItem icl_item=new ICLItem();
            icl_item.setCheckDetail(check_detail);
    
            ArrayList<ICLItem> icl_itemList=new ArrayList<ICLItem>();
            icl_itemList.add(icl_item);
    
            BundleHeaderRecord bhr=new BundleHeaderRecord();
            bhr.collectionTypeIndicator.setFieldData("01");
            bhr.destinationRoutingNumber.setFieldData(pb_routing_no);
            bhr.eceInstitutionRoutingNumber.setFieldData(inst_routing_no);
            bhr.bundleSequenceNumber.setFieldData("1");
    
            BundleControlRecord bcr=new BundleControlRecord();
            bcr.itemCount.setFieldData("1");
            bcr.bundleAmount.setFieldData(amount);
            bcr.micrAmount.setFieldData(amount);
            bcr.imagesInBundleCount.setFieldData("0");
    
            ForwardPresentmentBundle fpb=new ForwardPresentmentBundle(bhr,icl_itemList,bcr);
            ArrayList<ForwardPresentmentBundle> fpb_list=new ArrayList<ForwardPresentmentBundle>();
    
            ArrayList<ReturnBundle> rb_list=new ArrayList<ReturnBundle>();
            fpb_list.add(fpb);
    
            CashLetterHeaderRecord clhr=new CashLetterHeaderRecord();
            clhr.destinationRoutingNumber.setFieldData(pb_routing_no);
            clhr.eceInstitutionRoutingNumber.setFieldData(inst_routing_no);
            clhr.cashLetterRecordTypeIndicator.setFieldData("E");
            clhr.cashLetterDocumentationTypeIndicator.setFieldData("C");
    
            CashLetterControlRecord clcr=new CashLetterControlRecord();
            clcr.bundleCount.setFieldData("1");
            clcr.itemCount.setFieldData("1");
            clcr.cashLetterAmount.setFieldData(amount);
    
            CashLetter cl=new CashLetter(clhr,fpb_list,rb_list,clcr);
            ArrayList<CashLetter> cl_list=new ArrayList<CashLetter>();
            cl_list.add(cl);
    
            FileHeaderRecord fhr=new FileHeaderRecord();
            fhr.standardLevel.setFieldData("03");
            fhr.testFileIndicator.setFieldData("T");
            fhr.immediateDestinationRoutingNumber.setFieldData(pb_routing_no);
            fhr.immediateOriginRoutingNumber.setFieldData(inst_routing_no);
    
            FileControlRecord fcr=new FileControlRecord();
            fcr.cashLetterCount.setFieldData("1");
            fcr.totalRecordsCount.setFieldData("5");
            fcr.totalItemsCount.setFieldData("1");
            fcr.fileTotalAmount.setFieldData(amount);
    
            File f=new File("sample/abcd.ICL");
            ICLFile theIclFile = new ICLFile(fhr,cl_list,fcr,FileEncoding.ASCII);
    
            System.out.println("Entering application.");
    
            ICLFileWriter writer = new ICLFileWriter(theIclFile,f);
            writer.writeFile();
    
    
    
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    }
    

    }
    }

     
  • Jeff Gordy

    Jeff Gordy - 2016-11-21

    The short answer is that there isn't a shortcut to building the file. The only one I can think of would be to contact your processor and have them give you a valid file. Then read that as a base into your project and modify the fields you need to modify instead of building them by hand. However I'm not sure how much time that may save you in the end.

    You can think of this library as generally a fixed-width formatting library with some pre-build templates for specific records that are relevant to X9 files. There are some really good full-featured commercial packages out there which visually let you edit files that may be a good fit for your organization if this isn't doing what you need.

    Regarding the code you sent and your questions:

    1. The check detailc record requires the 8 digit routing number with the check digit in another field. I modified your ICL_Create.java to
    check_detail.payorBankRoutingNumber.setFieldData(pb_routing_no.substring(0, 8));
    

    And that passes the validation tests along with keeping the full routing number for other records that need all 9 digits.

    1. After making that chage the build fails because a few expected record types are missing. Like the images. I went ahead and modified ICLItem.java to return new empty lists if the expected records are null. After that your code runs fine and generates a file (although it is an incomplete file). Take a look at ICLItem.java in the repository and I'll also upload a new jar file shortly.

    -Jeff

     

    Last edit: Jeff Gordy 2016-11-21
  • Ali Shah

    Ali Shah - 2016-12-01

    Here comes a problem. When write file is completed bypassing all exceptions, the final file not contain image records i.e type 50 and 52 records are not present. i'm attaching the source and output file

     
  • Ali Shah

    Ali Shah - 2016-12-01

    How to write the image? is this method ImageViewDataRecord.populateFields(byte[] data) would work?
    How to use it? How to create and pass byte array?

     
  • Ali Shah

    Ali Shah - 2016-12-01

    here is my code to create ICL file but it gives exception while populating fields

    public static void create_icl()
    {
        try {
            String destination_name="Bank Of Punjab";
            String origin_name="Novaturesol";
            String origin_phone="090078601";
    

    // String aux_on_us="006005";
    String destination_routing_no="111310346";
    String ece_inst_routing_no="000909113";
    // Date date = new Date();
    // String modifiedDate= new SimpleDateFormat("YYYYMMDD HHMM").format(date);
    // String modifiedDateTime= new SimpleDateFormat("HHMM").format(date.getTime());
    String pb_routing_no="11191474";
    String pb_routing_no_cd="2";
    String amount="1010";
    String ece_inst_item_seq_no="101";
    // String ece_seq_no="9900010615";

            String modifiedDate="20161129";
            String modifiedDateTime="2029";
    
            CheckDetailRecord check_detail = new CheckDetailRecord();
            check_detail.recordType.setFieldData("25");
            check_detail.auxiliaryOnUs.setFieldData("               ");
            check_detail.externalProcessingCode.setFieldData(" ");
            check_detail.payorBankRoutingNumber.setFieldData(pb_routing_no.substring(0, 8));
            check_detail.payourBankRoutingNumberCheckDigit.setFieldData(pb_routing_no_cd);
            check_detail.onUs.setFieldData("                    ");
            check_detail.itemAmount.setFieldData(amount);
            check_detail.eceInstitutionItemSequenceNumber.setFieldData(ece_inst_item_seq_no);
            check_detail.documentationTypeIndicator.setFieldData("G");
            check_detail.returnAcceptanceIndicator.setFieldData(" ");
            check_detail.micrValidIndicator.setFieldData(" ");
            check_detail.bfdIndicator.setFieldData("N");
            check_detail.checkDetailRecordAddendumCount.setFieldData("1");
            check_detail.correctionIndicator.setFieldData(" ");
            check_detail.archiveTypeIndicator.setFieldData(" ");
    
    
            System.out.println("Check Detail Record ");
            System.out.println(check_detail.toString());
            check_detail.dump(System.out, "");
    
            ImageView imgview_f=new ImageView();
            ImageViewDetailRecord img_d_f_rec=new ImageViewDetailRecord();
            img_d_f_rec.recordType.setFieldData("50");
            img_d_f_rec.imageIndicator.setFieldData("0");
            img_d_f_rec.imageCreatorRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
            img_d_f_rec.imageCreatorDate.setFieldData(modifiedDate);
            img_d_f_rec.imageViewFormatIndicator.setFieldData("0");
            img_d_f_rec.imageViewCompressionAlgorithmIdentifier.setFieldData("0");
            img_d_f_rec.imageViewDataSize.setFieldData("0");
            img_d_f_rec.viewSideIndicator.setFieldData("0");
            img_d_f_rec.viewDescriptor.setFieldData("00");
            img_d_f_rec.digitialSignatureIndicator.setFieldData("0");
            img_d_f_rec.digitalSignatureMethod.setFieldData(" ");
            img_d_f_rec.securityKeySize.setFieldData(" ");
            img_d_f_rec.startProtectedData.setFieldData(" ");
            img_d_f_rec.lengthProtectedData.setFieldData(" ");
            img_d_f_rec.imageRecreateIndicator.setFieldData(" ");
            img_d_f_rec.userField.setFieldData(" ");
    
            System.out.println("ImageView Detail Record Front");
            System.out.println(img_d_f_rec.toString());
            img_d_f_rec.dump(System.out, "");
    
    
            byte[] imageStr=ImageManipulation.getImageByteString("sample/check.png");
    

    // String imgstrlen=Integer.toString(imageStr.length());
    ImageViewDataRecord img_data_f_rec=new ImageViewDataRecord();
    img_data_f_rec.recordType.setFieldData("52");
    img_data_f_rec.eceInstitutionRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
    img_data_f_rec.bundleBusinessDate.setFieldData(modifiedDate);
    img_data_f_rec.cycleNumber.setFieldData("1");
    img_data_f_rec.eceInstitutionItemSequenceNumber.setFieldData(ece_inst_item_seq_no);
    img_data_f_rec.securityOriginatorName.setFieldData(" ");
    img_data_f_rec.securityAuthenticatorName.setFieldData(" ");
    img_data_f_rec.securityKeyName.setFieldData(" ");
    img_data_f_rec.clippingOrigin.setFieldData("0");
    img_data_f_rec.clippingCoordinateH1.setFieldData(" ");
    img_data_f_rec.clippingCoordinateH2.setFieldData(" ");
    img_data_f_rec.clippingCoordinateV1.setFieldData(" ");
    img_data_f_rec.clippingCoordinateV2.setFieldData(" ");
    img_data_f_rec.lengthImageReferenceKey.setFieldData(" ");
    img_data_f_rec.populateFields(imageStr);
    // img_data_f_rec.imageReferenceKey.setFieldData("0");
    // img_data_f_rec.lengthDigitalSignature.setFieldData(" ");
    // img_data_f_rec.digitalSignature.setFieldData("0");
    // img_data_f_rec.lengthImageData.setFieldData(" ");
    // img_data_f_rec.lengthImageData.setFieldData(imgstrlen);
    // img_data_f_rec.imageData.setFieldData(imageStr);

            System.out.println("ImageView Data Record Front");
            System.out.println(img_data_f_rec.toString());
            img_data_f_rec.dump(System.out, "");
    
            imgview_f.setImageViewDetail(img_d_f_rec);
            imgview_f.setImageViewData(img_data_f_rec);
    

    // imgview_f.saveImage("check.png", "sample");

    // System.out.println(imgview_f.toString());
    // imgview_f.saveImage("check.png", "sample");

            ImageView imgview_b=new ImageView();
            ImageViewDetailRecord img_d_b_rec=new ImageViewDetailRecord();
            img_d_b_rec.recordType.setFieldData("50");
            img_d_b_rec.imageIndicator.setFieldData("0");
            img_d_b_rec.imageCreatorRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
            img_d_b_rec.imageCreatorDate.setFieldData(modifiedDate);
            img_d_b_rec.imageViewFormatIndicator.setFieldData("0");
            img_d_b_rec.imageViewCompressionAlgorithmIdentifier.setFieldData("0");
            img_d_b_rec.imageViewDataSize.setFieldData("0");
            img_d_b_rec.viewSideIndicator.setFieldData("1");
            img_d_b_rec.viewDescriptor.setFieldData("00");
            img_d_b_rec.digitialSignatureIndicator.setFieldData("0");
            img_d_b_rec.digitalSignatureMethod.setFieldData(" ");
            img_d_b_rec.securityKeySize.setFieldData(" ");
            img_d_b_rec.startProtectedData.setFieldData(" ");
            img_d_b_rec.lengthProtectedData.setFieldData(" ");
            img_d_b_rec.imageRecreateIndicator.setFieldData(" ");
            img_d_b_rec.userField.setFieldData(" ");
    
            System.out.println("ImageView Detail Record Back");
            System.out.println(img_d_b_rec.toString());
            img_d_b_rec.dump(System.out, "");
    
            ImageViewDataRecord img_data_b_rec=new ImageViewDataRecord();
            img_data_b_rec.recordType.setFieldData("52");
            img_data_b_rec.eceInstitutionRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
            img_data_b_rec.bundleBusinessDate.setFieldData(modifiedDate);
            img_data_b_rec.cycleNumber.setFieldData("1");
            img_data_b_rec.eceInstitutionItemSequenceNumber.setFieldData(ece_inst_item_seq_no);
            img_data_b_rec.securityOriginatorName.setFieldData(" ");
            img_data_b_rec.securityAuthenticatorName.setFieldData(" ");
            img_data_b_rec.securityKeyName.setFieldData(" ");
            img_data_b_rec.clippingOrigin.setFieldData("0");
            img_data_b_rec.clippingCoordinateH1.setFieldData(" ");
            img_data_b_rec.clippingCoordinateH2.setFieldData(" ");
            img_data_b_rec.clippingCoordinateV1.setFieldData(" ");
            img_data_b_rec.clippingCoordinateV2.setFieldData(" ");
            img_data_b_rec.lengthImageReferenceKey.setFieldData("0");
            img_data_b_rec.populateFields(imageStr);
    

    // img_data_b_rec.imageReferenceKey.setFieldData("0");
    // img_data_b_rec.lengthDigitalSignature.setFieldData("0");
    // img_data_b_rec.digitalSignature.setFieldData("0");
    // img_data_b_rec.lengthImageData.setFieldData(imgstrlen);
    // img_data_b_rec.imageData.setFieldData(imageStr);

            System.out.println("ImageView Data Record Back");
            System.out.println(img_data_b_rec.toString());
            img_data_b_rec.dump(System.out, "");
    
            imgview_b.setImageViewDetail(img_d_b_rec);
            imgview_b.setImageViewData(img_data_b_rec);
    

    // imgview_b.saveImage("check.png", "sample");

            ICLItem icl_item=new ICLItem();
            icl_item.setDetailRecord(check_detail);
    
    
            ArrayList<CheckDetailAddendumCRecord> checkDetailAddendumCList=new ArrayList<CheckDetailAddendumCRecord>();
            ArrayList<ImageView> img_list=new ArrayList<ImageView>();
            img_list.add(imgview_f);
            img_list.add(imgview_b);
            icl_item.setCheckDetailAddendumCList(checkDetailAddendumCList);
            icl_item.setImageViewList(img_list);
            ArrayList<ICLItem> icl_itemList=new ArrayList<ICLItem>();
            icl_itemList.add(icl_item);
    
    
            BundleHeaderRecord bhr=new BundleHeaderRecord();
            bhr.recordType.setFieldData("20");
            bhr.collectionTypeIndicator.setFieldData("03");
            bhr.destinationRoutingNumber.setFieldData(destination_routing_no);
            bhr.eceInstitutionRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
            bhr.bundleBusinessDate.setFieldData(modifiedDate);
            bhr.bundleCreationDate.setFieldData(modifiedDate);
            bhr.bundleID.setFieldData("1");
            bhr.bundleSequenceNumber.setFieldData("1");
            bhr.cycleNumber.setFieldData("1");
            bhr.returnLocationRoutingNumber.setFieldData(" ");
            bhr.userField.setFieldData(" ");
            bhr.reserved.setFieldData(" ");
    
            System.out.println("Bundle Header Record");
            System.out.println(bhr.toString());
            bhr.dump(System.out, "");
    
            BundleControlRecord bcr=new BundleControlRecord();
            bcr.recordType.setFieldData("70");
            bcr.itemCount.setFieldData("1");
            bcr.bundleAmount.setFieldData(amount);
            bcr.micrAmount.setFieldData(amount);
            bcr.imagesInBundleCount.setFieldData("0");
            bcr.userField.setFieldData(" ");
            bcr.userField.setFieldData(" ");
    
            System.out.println("Bundle Control Record");
            System.out.println(bcr.toString());
            bcr.dump(System.out, "");
    
            ForwardPresentmentBundle fpb=new ForwardPresentmentBundle(bhr,icl_itemList,bcr);
    
            ArrayList<ForwardPresentmentBundle> fpb_list=new ArrayList<ForwardPresentmentBundle>();
    
            ArrayList<ReturnBundle> rb_list=new ArrayList<ReturnBundle>();
            fpb_list.add(fpb);
    
            CashLetterHeaderRecord clhr=new CashLetterHeaderRecord();
            clhr.recordType.setFieldData("10");
            clhr.collectionTypeIndicator.setFieldData("03");
            clhr.destinationRoutingNumber.setFieldData(destination_routing_no);
            clhr.eceInstitutionRoutingNumber.setFieldData(ece_inst_routing_no.substring(1,9));
            clhr.cashLetterBusinessDate.setFieldData(modifiedDate);
            clhr.cashLetterCreationDate.setFieldData(modifiedDate);
            clhr.cashLetterCreationTime.setFieldData(modifiedDateTime);
            clhr.cashLetterRecordTypeIndicator.setFieldData("I");
            clhr.cashLetterDocumentationTypeIndicator.setFieldData("G");
            clhr.cashLetterID.setFieldData("1");
            clhr.originatorContactName.setFieldData("Novaturesol");
            clhr.originatorContactPhoneNumber.setFieldData("090078601");
            clhr.fedWorkType.setFieldData(" ");
            clhr.userField.setFieldData(" ");
            clhr.reserved.setFieldData(" ");
    
            System.out.println("Cash Letter Header Record");
            System.out.println(clhr.toString());
            clhr.dump(System.out, "");
    
            CashLetterControlRecord clcr=new CashLetterControlRecord();
            clcr.recordType.setFieldData("90");
            clcr.bundleCount.setFieldData("1");
            clcr.itemCount.setFieldData("1");
            clcr.cashLetterAmount.setFieldData(amount);
            clcr.imagesWithinCashLetterCount.setFieldData("2");
            clcr.eceInstitutionName.setFieldData(" ");
            clcr.settlementDate.setFieldData(" ");
            clcr.reserved.setFieldData(" ");
    
            System.out.println("Cash Letter Header Record");
            System.out.println(clcr.toString());
            clcr.dump(System.out, "");
    
            CashLetter cl=new CashLetter(clhr,fpb_list,rb_list,clcr);
            ArrayList<CashLetter> cl_list=new ArrayList<CashLetter>();
            cl_list.add(cl);
    
            FileHeaderRecord fhr=new FileHeaderRecord();
            fhr.recordType.setFieldData("01");
            fhr.standardLevel.setFieldData("03");
            fhr.testFileIndicator.setFieldData("T");
            fhr.immediateDestinationRoutingNumber.setFieldData(destination_routing_no);
            fhr.immediateOriginRoutingNumber.setFieldData(destination_routing_no);
            fhr.fileCreationDate.setFieldData(modifiedDate);
            fhr.fileCreationTime.setFieldData(modifiedDateTime);
            fhr.resendIndicator.setFieldData("N");
            fhr.immediateDesitinationName.setFieldData(destination_name);
            fhr.immediateOriginName.setFieldData(origin_name);
            fhr.fileIDModifier.setFieldData("1");
            fhr.countryCode.setFieldData(" ");
            fhr.userField.setFieldData(" ");
            fhr.reserved.setFieldData(" ");
    
            System.out.println("File Header ");
            System.out.println(fhr.toString());
            fhr.dump(System.out, "");
    
            FileControlRecord fcr=new FileControlRecord();
            fcr.recordType.setFieldData("99");
            fcr.cashLetterCount.setFieldData("1");
            fcr.totalRecordsCount.setFieldData("21");
            fcr.totalItemsCount.setFieldData("1");
            fcr.fileTotalAmount.setFieldData(amount);
            fcr.immediateOriginContactName.setFieldData(destination_name);
            fcr.immediateOriginContactPhone.setFieldData(origin_phone);
            fcr.reserved.setFieldData(" ");
    
            System.out.println("File Control ");
            System.out.println(fcr.toString());
            fcr.dump(System.out, "");
    
            File f=new File("sample/abcde.ICL");
            ICLFile theIclFile = new ICLFile(fhr,cl_list,fcr,FileEncoding.ASCII);
    
            System.out.println("Entering application.");
    
            ICLFileWriter writer = new ICLFileWriter(theIclFile,f);
            writer.writeFile();
    
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    }
    

    and here is my stacktrace after exception

    org.cdgsoftware.icl.util.ICLException: Error setting: Image View Data Record
    Field Validation Failed: This Record Type is UCD v1 and DSTU x9.37 compliant. The record type value [?P] is not a valid type. You can subclassField yourself to allow your record type to be set. data passed: [?P]
    at org.cdgsoftware.icl.field.Field.setFieldData(Field.java:287)
    at org.cdgsoftware.icl.record.ImageViewDataRecord.populateThroughField14(ImageViewDataRecord.java:210)
    at org.cdgsoftware.icl.record.ImageViewDataRecord.populateFields(ImageViewDataRecord.java:187)
    at com.novaturesol.icl.Main.create_icl(Main.java:119)
    at com.novaturesol.icl.Main.main(Main.java:29)

     
  • Rajeswararao

    Rajeswararao - 2018-12-12

    Hi everyone,

    Any one have solution for the above issue(image writing on ICL file).
    Kindly let me know, its urgent please.

     

    Last edit: Rajeswararao 2018-12-12

Log in to post a comment.

MongoDB Logo MongoDB