Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jPOS logger :To add logger in packager

I am implementing ATM Simulator, which accepts ISO8583 msg from client and unpack it using jPOS library. Error that has occured while unpacking my msg is : "error unpacking field 102: negativearraysizeexception" . I researched about this error and thought about adding logger to my program so that on printing, i would get the information on which data is going into which field.
Code that i include in my existing java application is as follows :

Logger logger = new Logger();
logger.addListener (new SimpleLogListener(System.out));
((LogSource)p).setLogger(logger, "debug");// p is my ISOPackger

It is giving me compilation error as
1- Constructor Logger() is undefined

2- Method addListener is undefined for type Logger

3- LogSource cannot be resolved to a type

Help me in solving these errors. Any help would be appreciated. Thanks in advance.

like image 335
user3985315 Avatar asked Oct 01 '14 10:10

user3985315


3 Answers

Regarding that error "error unpacking field 102: negativearraysizeexception"

I can help because it happened to me.

Check iso87cscascii.xml file in the configuration folder, each field length and type in that file must be identical to the ISO Message you received.

Probably the field number in the error (102) is where that error occurred, please check that field precisely, and also check other fields to guarantee that error will not happen again.

like image 55
Abubaker Enayet Avatar answered Nov 05 '22 09:11

Abubaker Enayet


You're probably not importing org.jpos.util.Logger and picking some other Logger.

jPOS' Logger do have a no args constructor.

See javadocs here: http://jpos.org/doc/javadoc/org/jpos/util/Logger.html#Logger()

like image 21
apr Avatar answered Nov 05 '22 08:11

apr


Could you post full java class? I guess you added incorrect Jpos libraries

1- Constructor Logger() is undefined

Do you use import org.jpos.util.Logger?

2- Method addListener is undefined for type Logger

Be sure you use exactly jpos library.

like image 2
nofomopls Avatar answered Nov 05 '22 07:11

nofomopls