Issue parsing subfields

95 views
Skip to first unread message

Judah Ben

unread,
Jul 6, 2024, 1:38:45 PM (2 days ago) Jul 6
to jPOS Users
Hi, I'm having issues parsing messages using my packager. I'm using a custom generic packager I've fitted to the host's specifications (here). I've attached the packager below, an image of how I'm setting the fields and sub-fields in code.

View packager here

Error: "org.jpos.iso.ISOException: error packing field 0 (org.jpos.iso.ISOException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.BitSet (java.lang.ClassCastException: java.lang.String cannot be cast to java.util.BitSet))"

Not sure why this is, it looks like it is not expecting the way I'm accessing the subfields (like "0.1") or so.
Please assist.



Screenshot 2024-07-06 at 18.13.01.png


*Sent a conversation earlier, but I believe it didn't get created because i can't find it

Mark Salter

unread,
Jul 6, 2024, 1:42:11 PM (2 days ago) Jul 6
to jpos-...@googlegroups.com

First, do not publish works  you do not own - even links to sites breaching that copyright!

You will need a packager that defines the specification you need,  field 0 is used for bitmap, which is why it is not working as you hoped.

-- 
Mark



-------- Original Message --------
--
--
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 Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/5e25aae6-b2c5-497d-942a-618ac39aba91n%40googlegroups.com.
Screenshot 2024-07-06 at 18.13.01.png
signature.asc

Mark Salter

unread,
Jul 6, 2024, 1:45:09 PM (2 days ago) Jul 6
to jpos-...@googlegroups.com

>> *Sent a conversation earlier, but I believe it
>> didn't get created because i can't find it

All first time posts need approval before they appear, so there will be a delay.

Unfortunately I missed you had linked to a shared copyright work, sorry to all members for missing that!
-- 
Mark



-------- Original Message --------
On 06/07/2024 18:18, Judah Ben wrote:
--
Screenshot 2024-07-06 at 18.13.01.png
signature.asc

Andrés Alcarraz

unread,
Jul 6, 2024, 2:05:41 PM (2 days ago) Jul 6
to jpos-...@googlegroups.com

I believe what you call field 0.1 is in fact the header of the message and is not something the packager takes care of, but the channel. You set it through the ISOMsg.setHeader method.

Then MTI is the real first field (field 0).

You don’t set the bitmaps, they are calculated for you by the packager, and that is what is causing the exception you see.

Andrés Alcarraz

Mark Salter

unread,
Jul 7, 2024, 2:52:07 AM (yesterday) Jul 7
to jpos-...@googlegroups.com

I have declined your last replies as you continue to link to inappropriately shared copyright materials.

Whilzt I  don't think you have uploaded them, it is still supporting the practice of stealing other peoples commercial work by generating hits.

I am certain worldpay do not publish their documents in this manner.

Please redo your replies without links and clear the links in their history too  as you do so, then they will be approved.

--
Mark

-------- Original Message --------
On 06/07/2024 18:18, Judah Ben wrote:

Hi, I'm having issues parsing messages using my packager. I'm using a custom generic packager I've fitted to the host's specifications (here). I've attached the packager below, an image of how I'm setting the fields and sub-fields in code.

View packager here

Error: "org.jpos.iso.ISOException: error packing field 0 (org.jpos.iso.ISOException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.BitSet (java.lang.ClassCastException: java.lang.String cannot be cast to java.util.BitSet))"

Not sure why this is, it looks like it is not expecting the way I'm accessing the subfields (like "0.1") or so.

Please assist. .

signature.asc

Judah Ben

unread,
Jul 7, 2024, 11:39:41 AM (yesterday) Jul 7
to jPOS Users
Hello Mark,

I appreciate your diligence in moderating the forum. I want to clarify that the information I shared comes from the Worldpay ISO 8583 specification document, which is publicly available online. My intention was to provide context for my question by sharing relevant screenshots, which I've uploaded to a private drive solely for this discussion.

I understand the concern about sharing others' work. However, in this case, I'm not sure how to reference the specific portions of the document without using screenshots. If there's a preferred method for sharing this kind of information on the forum, I'd be happy to follow that guideline.

Could you advise.

Mark Salter

unread,
Jul 7, 2024, 12:03:07 PM (yesterday) Jul 7
to jpos-...@googlegroups.com
On 07/07/2024 11:21, Judah Ben wrote:
Hello Mark,

Hi from myself and 2000+ other people who might be readin your post and perhaps this reply.


I appreciate your diligence in moderating the forum. I want to clarify that the 
information I shared comes from the Worldpay ISO 8583 specification document, 
which is publicly available online. 
If WorldPay actually do publish it online and for public use, then link to that document.  I suspect that they do not, but am very happy if you can prove me wrong.

My intention was to provide context for my 
question by sharing relevant screenshots,
Screenshots of copyrighted that a company owns?  I class that a reproducing works and thus breaking the copyright this propriety documentation will state..

 which I've uploaded to a private drive

At the point you shared it on a public forum, it is not private and is not yours to upload in any case, ever without express permission.

This is illegal and not welcome here since you are publishing works that you do not own and should not have shared the WorldPay document in this manner - I strongly suggest that you remove that 'private' upload as soon as you can, since it will be reported.

  
solely for this discussion.
... on a public forum with public access - i.e. public.


I understand the concern about sharing others' work.
Yet you choose to upload it and share it here.

 However, in this case, I'm 
not sure how to reference the specific portions of the document without using 
screenshots.
You describe your need in detail, using the document as your personal reference if you are allowed to.  I am not going to tell you how to do that, since it should I think be completely obvious how to describe a problem you may be having using jpos for a particular purpose.  See here perhaps  :  http://www.catb.org/~esr/faqs/smart-questions.html  for your starting guide.

 If there's a preferred method for sharing this kind of information 
on the forum, I'd be happy to follow that guideline.

As above, just form your own words to describe the issue, mention the company name and perhaps specification date/version (someone else may already have it or remember and so be able to help - given the context and stated issue.

Andreas has likely already shared the solution, but remember your reply is not visible since I removed it as shared.


--

Mark


signature.asc
Message has been deleted
Message has been deleted
Message has been deleted

Judah Ben

unread,
Jul 7, 2024, 3:22:38 PM (yesterday) Jul 7
to jPOS Users
Hi, my replies are getting automatically deleted. 
Am I doing something wrong?

I have deleted the content of the initial drive link and it currently points to nothing.
I have also refrained from adding links to copyrighted materials.

The only links I've attached are the ones to Worldpay's specification (as per Mark's request) and the one to the packager which I modified myself.

Is there something else I have missed?
Please help point out.

Judah Ben

unread,
Jul 7, 2024, 3:23:00 PM (yesterday) Jul 7
to jPOS Users
I understand your perspective fully.
Thanks for laying it out.

Here's the document.
I'm conversant with field 0 being used for MTI, but I'm contrasting with the specification (page 232 -235) that indicates that field 0 has 3 subfields - 
0.1 -> Terminal Application Header
0.2 -> MTI
0.3 -> Primary Bitmap
and then field 1 as secondary Bitmap

I've defined all these in the custom packager, but it appears Jpos is not expecting the way I'm setting the fields (like "0.1"...) for some element.

I believe I'm either missing the correct data type in my packager or the notation for setting the subfields is off.
Please assist.

On Sunday, July 7, 2024 at 5:03:07 PM UTC+1 Mark Salter wrote:

Judah Ben

unread,
Jul 7, 2024, 3:23:20 PM (yesterday) Jul 7
to jPOS Users
Hi Andrés,
Thanks for responding.

The host's specification (here - page 232 to 235) seems to customize field 0 to contain subfields.

0.1 -> Terminal Application Header
0.2 -> MTI
0.3 -> Primary Bitmap
and then field 1 as secondary Bitmap (as opposed to primary)

I also understand from further down in the doc (page 599 - 602) that there's a separate header to be included with the message.
I'm thinking this header is the one to be taken care of the channel.

For the bitmap, it's not clear how to let the packager do this for me with the current customization.
I'm thinking to create a wrapper class that extends from GenericPackager and modifies the pack() method to achieve this, but I'm certain there's a better way of doing it.

Could you help out please.

Mark Salter

unread,
Jul 7, 2024, 3:25:07 PM (yesterday) Jul 7
to jpos-...@googlegroups.com
On 07/07/2024 18:58, Judah Ben wrote:
Hi, my replies are getting automatically deleted.
Am I doing something wrong?
They are not getting auto deleted, you are on moderation, so until someone approves your messages they are waiting to be posted.


--

Mark

signature.asc

Mark Salter

unread,
Jul 7, 2024, 3:37:16 PM (yesterday) Jul 7
to jpos-...@googlegroups.com
On 07/07/2024 18:48, Judah Ben wrote:
The host's specification (here 
<https://developerengine.fisglobal.com/assets/pdf/Worldpay_ISO_8583_Reference_Guide_V2.46.pdf> - page 232 to 235) seems to customize field 0 to contain subfields.
Great, published by worldpay directly - how nice and rather surprising :-) - thanks for linking to their version, and I stand corrected, but very good to know there was no need for you to take and publish and then link to a copy you made.


0.1 -> Terminal Application Header
0.2 -> MTI
0.3 -> Primary Bitmap
and then field 1 as secondary Bitmap (as opposed to primary)

I also understand from further down in the doc (page 599 - 602) that there's a 
separate header to be included with the message.
I'm thinking this header is the one to be taken care of the channel.
This section seems to apply for acquirers whose terminals are connecting and sending to worldpay - are you acquiring or Issuing or both?

For the bitmap, it's not clear how to let the packager do this for me with the 
current customization.

Perhaps just forget their number in terms of jPos packager, include the acquiring header (if that is your goal) with 0.1 and then a normal MTI structure that a jPos packager will naturally handle (ISOMsg.getMTI and perhaps ISOMsg. tring("35") for the track 2) seems to follow;  this is only if you are coding a terminal for connection though.


If just Issuing - check the spec and perhaps then your header can just handle 0.1 and the rest might be  straightforward

I'm thinking to create a wrapper class that extends from GenericPackager and 
modifies the pack() method to achieve this, but I'm certain there's a better way 
of doing it.

You can do that, but perhaps try and absorb the 'leading data' as a header and then process the rest as a straight ISOMsg out of the channel starting with the MTI, but with 0.1 header (perhaps preceeded with the other header if you are building a message like a terminal terminal).

--

Mark

signature.asc

Judah Ben

unread,
Jul 7, 2024, 7:15:08 PM (21 hours ago) Jul 7
to jPOS Users
It appears the error is from Google Groups or so.
Screenshot 2024-07-07 at 23.55.42.png

Judah Ben

unread,
Jul 7, 2024, 7:15:16 PM (21 hours ago) Jul 7
to jPOS Users

Thanks for your understanding and the detailed explanation, Mark.
Yes, I'm acting on the acquiring side, with the actual terminal device making the connection.

If I understand correctly, you mean I should also leave out setting the subfields so the packager can handle them?

If I'm to stitch the leading data header to the separate message header and send it from the channel, is this the correct approach:

  1. Create a custom ISOHeader implementation that combines both the acquiring header (0.1) and the separate message header?
  2. Set this custom header using ISOMsg.setHeader()?
  3. Use standard jPOS methods (like setMTI(), set()) for the rest of the fields, allowing the packager to handle the bitmap automatically?
  4. Also, other fields like 115 use subfields too. Is the notation "x.y" correct for this?

Could you confirm if this is the right direction, or if there's a better way to structure this while still meeting the specifications?

Reply all
Reply to author
Forward
0 new messages