> When I send the message as bytes -
>
> channel.send(m.getBytes())
>
> I get the following error message:
>
> Exception in thread "main" org.jpos.iso.ISOException: N/A in Composite
> at org.jpos.iso.ISOComponent.getBytes(ISOComponent.java:94)
> at com.access.jpos.Test.main(Test.java:129)
>
This is test code, perhaps using the examples in the Programmers guide
would be a good place to start you off?
From here, we can't tell what is in your ISOMsg, your fields, amongst
other things.
> And when I set the field values as bytes:
>
> m.set(fld, stringValue.getBytes());
m.set(fld,stringValue) should work, but it depends on which field number
and which packager you are trying to set here.
>
> I get the following error message:
>
> Exception in thread "main" org.jpos.iso.ISOException:
> org.jpos.iso.IFB_NUMERIC: Problem packing field 0
> (java.lang.ClassCastException: [B cannot be cast to java.lang.String)
> at
> org.jpos.iso.ISOStringFieldPackager.pack(ISOStringFieldPackager.java:
> 150)
> at org.jpos.iso.ISOBasePackager.pack(ISOBasePackager.java:94)
> at org.jpos.iso.ISOMsg.pack(ISOMsg.java:405)
> at com.access.jpos.Test.main(Test.java:129)
>
> I use ISO87BPackager and even set the packager before sending -
> m.setPackager(new ISO87BPackager());
What data are you putting in which field number in the ISOMsg? How?
It looks to me that a pack time, the field is expecting a String and you
have given it a byte[].
The ISOMsg and Packager take care of any conversion for you, once you
have the right packager, almost all of your code interactions with the
ISOMsg will be using Strings.
> Any help will be appreciated.
>
Get the programmers guide, search this list, ask smart questions ( a
link to a guide to asking them, you will find in your search)...
--
Mark