jPOS logger :To add logger in packager
Asked Answered
C

4

5

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.

Cataclysm answered 1/10, 2014 at 10:24 Comment(0)
A
4

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.

Anguished answered 5/11, 2014 at 6:27 Comment(0)
W
2

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()

Wideawake answered 1/10, 2014 at 15:7 Comment(0)
F
2

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.

Fulkerson answered 29/7, 2015 at 2:57 Comment(0)
B
0

This happened to me. It was just a conflict with the SLF4J logger.

Brockway answered 13/7, 2017 at 11:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.