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) {
}
}
}
Hi,
Your stack trace is showing the issue for this particular condition:
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
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.
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
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
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";
// theIclFile.setCashLetterList();
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";
}
}
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:
And that passes the validation tests along with keeping the full routing number for other records that need all 9 digits.
-Jeff
Last edit: Jeff Gordy 2016-11-21
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
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?
here is my code to create ICL file but it gives exception while populating fields
// 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 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);
// imgview_f.saveImage("check.png", "sample");
// System.out.println(imgview_f.toString());
// imgview_f.saveImage("check.png", "sample");
// 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);
// imgview_b.saveImage("check.png", "sample");
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)
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