NPE when packing DE48 in a custom Subfld packager, fashioned from Euro sub-fld packager.

67 views
Skip to first unread message

JayPoser

unread,
Jan 5, 2009, 8:51:25 PM1/5/09
to jPOS Users
In pack(), at what would line-78 in the euro packager, a
NullPointerException is experienced with "byte[] b = fld[i].pack(f);",
when packing DE48.

However, the issue is that the NPE happens in one env, but not in the
other.
We've compared code and settings many times and came up empty.
NPE @ MySubFieldPackager.pack(MySubFieldPackager.java:55)
at org.jpos.iso.ISOMsgFieldPackager.pack(ISOMsgFieldPackager.java:57)
at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:119)
at org.jpos.iso.ISOMsg.pack(ISOMsg.java:331)
at org.jpos.iso.BaseChannel.send(BaseChannel.java:504)
at CustomNACChannel.send(CustomNACChannel.java:114)

The DE48 definition omits some fields on purpose, meaning only
subfields 0/11/33/34.. are defined,
but again it seems to work in env-1, but fails in env-2:
<isofieldpackager
id="48" length="100" name="FIELD 48"
class="org.jpos.iso.IFA_LLLBINARY"
packager="MySubFieldPackager">
<isofield id="0" length="1" name="TCC"
class="org.jpos.iso.IF_CHAR"/>
<isofield id="11"...
<isofield id="33"...


The NPE seems to come from this fact that not all fields are defined,
so one obvious correction would be is to
defined all the sub-fields. However, that might mess up the format of
DE48, so I'm hesitant on it.

Obviously, I realize that this is custom code, so good luck to me,
still, I was hoping for some helpful suggestions.
The custom sub-fld packager differs from its euro brother by name and
a minor mod to unpack().

The jpos systems in question are running under weblogic 9.2,
jrockit910 on Windows XP SP2.

Thanks for your help in advance,
Karl

Zablon Ochomo

unread,
Jan 6, 2009, 1:09:29 AM1/6/09
to jpos-...@googlegroups.com
What if you setup the missing fields like example below:
 
            <isofield id="! missing ID goes here"
            name="NOT PRESENT"
            length="0"
            pad="false"
            class="org.jpos.iso.IF_NOP"/>


chhil

unread,
Jan 6, 2009, 1:24:32 AM1/6/09
to jpos-...@googlegroups.com
Although the environments are identical you are receiving different
data from the remote entity which is causing the problem you are
seeing.
So it looks like your field 48 is not bitmapped, should it not be a
bitmap to enable the detection of fields being absent or present?

-chhil

JayPoser

unread,
Jan 6, 2009, 9:50:07 AM1/6/09
to jPOS Users
Yes, filling out the missing fld defs was going to be another choice,
although I must admit the IF_NOP didn't occur to me. Thanks for the
suggestion!

On Jan 5, 10:09 pm, "Zablon Ochomo" <ocho...@gmail.com> wrote:
> What if you setup the missing fields like example below:
>
>             <isofield id="! missing ID goes here"
>             name="NOT PRESENT"
>             length="0"
>             pad="false"
>             class="org.jpos.iso.IF_NOP"/>
>
> --
> Zablon Ochomo

JayPoser

unread,
Jan 6, 2009, 9:56:39 AM1/6/09
to jPOS Users
So, the error is not due to any remote entity, as it is manifesting
itself in our send() operation's packing process.

At the same time, the DE48 packager definition is modeled after the
Europay packager, with the exception of the missing field definitions
in ours.

On Jan 5, 10:24 pm, chhil <chil...@gmail.com> wrote:
> Although the environments are identical you are receiving different
> data from the remote entity which is causing the problem you are
> seeing.
> So it looks like your field 48 is not bitmapped, should it not be a
> bitmap to  enable the detection of fields being absent or present?
>
> -chhil
>

JayPoser

unread,
Jan 6, 2009, 11:50:25 AM1/6/09
to jPOS Users
So, it did turn out to be a cfg mishap after all! Had to read every
cfg spec for the channels 15 times, but eventually a packager def was
spotted to be referring to an early version of DE48 that was copied
verbatim from the Europay packager definition, listing all its
original fields. At least the mistery is now solved. Thanks again for
your help!
Reply all
Reply to author
Forward
0 new messages