JpOS logger: add logger to packer

I am implementing an ATM Simulator that receives ISO8583 msg from a client and decompresses it using the jPOS library. An error occurred while unpacking my message: "Error decompression field 102: negativearraysizeexception". I investigated this error and thought about adding a registrar to my program so that when printing I get information about what data goes to which field.
The code that I am including in an 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 

This gives me a compilation error since 1- Constructor Logger () is undefined

2- addListener method undefined for Logger type

3 LogSource cannot be allowed for type

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

+5
source share
4 answers

Regarding this error, "error decompression field 102: negativearraysizeexception"

I can help because it happened to me.

Check the iso87cscascii.xml file in the configuration folder, each length and field type in this file should be identical to the received ISO message.

There is probably a field number in the error (102) where this error occurred, please check this field for sure, and also check other fields to ensure that the error does not happen again.

+4
source

You probably do not import org.jpos.util.Logger and choose a different Logger.

jPOS 'Logger does not have an args constructor.

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

+2
source

Could you host the full java class? I think you added the wrong Jpos libraries

1- Constructor Logger () - undefined

Are you using import org.jpos.util.Logger?

2- addListener method undefined for Logger type

Make sure you use the jpos library exactly.

+2
source

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

0
source

Source: https://habr.com/ru/post/1203783/


All Articles