How to use GenericPackager or ISO87BPackager in Android?

946 views
Skip to first unread message

Brave

unread,
Apr 25, 2013, 1:34:15 PM4/25/13
to jpos-...@googlegroups.com
Hi, 
When I link and compile jpos lib in java project, it runs well. But when I use jpos lib for android, always get exception when use class: GenericPackager or ISO87BPackager.

java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl
org.jpos.iso.ISOException: java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl (java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl)
at org.jpos.iso.packager.GenericPackager.readFile(GenericPackager.java:202)

My code: 
public static byte[] buid(InputStream in) throws IOException, ISOException {
// Create Packager based on XML that contain DE type
GenericPackager packager = new GenericPackager(in);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.setMTI("0200");
isoMsg.set(3, "000000");
isoMsg.set(4, "10000");
//isoMsg.set(7, "110722180");
isoMsg.set(11, "123456");
isoMsg.set(41, "12345678");
//isoMsg.set(105, "ABCDEFGHIJ 1234567890");

// print the DE list
logISOMsg(isoMsg);

// Get and print the output result
byte[] data = isoMsg.pack();
System.out.println("RESULT : " + new String(data));
return data;
}

What should I do?

Thanks,
Brave.

chhil

unread,
Apr 25, 2013, 2:02:43 PM4/25/13
to jpos-...@googlegroups.com
Try google:
See the comment section at http://jimmod.com/blog/2011/07/jimmys-blog-iso-8583-tutorial-build-and-parse-iso-message-using-jpos-library/

"If you want to do it yourself override Generic packager with your own class that implements SAX Parser instead of default Crimson parser."

http://mobile.tutsplus.com/tutorials/android/android-sdk-build-a-simple-sax-parser/

-chhil

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
 
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joseph Olanrewaju

unread,
Jul 19, 2015, 11:06:31 PM7/19/15
to jpos-...@googlegroups.com
Hello Brave,

Can you please share your solution to the problem you had with the GenericPackager? I also have the same problem and I have not been able to get by it.

Thanks
Reply all
Reply to author
Forward
0 new messages