|
From: Alvin W. <AW...@FF...> - 2006-11-16 19:43:22
|
Hi Steve,
Sorry for bothering so many times on this. I dig a little more. My code=
created Message object like below:
public static Message getMesage(String msg) throws Exception
{
Message message =3D new Message();
StringTokenizer tokenizer =3D new StringTokenizer(msg, "\001");=
while (tokenizer.hasMoreElements())
{
String str =3D tokenizer.nextToken();
int loc =3D str.indexOf('=3D');
message.setString(Integer.parseInt(str.substring(0, loc)),
str.substring(loc + 1));
}
return message;
}
And later, it did a toString on the message object. So the bottom line =
is
that the code did something like:
getMessage(msg).toString() and caused the exeption.
Maybe you can also advise a better way to construct a Message object ba=
sed
on a message String.
thanks
=
steve@technoetic. =
com =
Sent by: =
To
quickfixj-users-b qui...@li...=
e.n
ou...@li... et =
ceforge.net =
cc
=
Subj=
ect
11/16/2006 02:30 Re: [Quickfixj-users] =
PM quickfix.Message.toString() =
NullPointerException =
=
Please respond to =
quickfixj-users@l =
ists.sourceforge. =
net =
=
=
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/
Hi Alvin,
I was able to successfully parse and format the message.
Steve
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
> I think it is because I changed the couterparty compid to be AAAAAAA =
for
> privacy reason.
> I will send you the original msg privately. Could you try to parse it=
to
> be
> a ExeutionReport object and do a toString()?
>
> thanks
>
>
>
>
>
>
> steve@technoetic.
> com
> Sent by:
To
> quickfixj-users-b
qui...@li....n
> ou...@li... et
> ceforge.net
cc
>
>
Subject
> 11/16/2006 12:07 Re: [Quickfixj-users]
> PM quickfix.Message.toString()
> NullPointerException
>
> Please respond to
> quickfixj-users@l
> ists.sourceforge.
> net
>
>
>
>
>
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
> I can't parse that message. The error I see is...
>
> quickfix.InvalidMessage: Actual body length=3D576, Expected body leng=
th=3D578
>
> If I set the length to the correct length and adjust the checksum
> accordingly, the message parses and formats without error.
>
> Steve
>
>
>> 8=3DFIX.4.4=019=3D578=0135=3D8=0149=3DAAAAAAA=0156=3DFFTWFIX=0134=3D=
12=0152=3D20061115-15:52:57.357=01
>> 347=3DUTF-8=0137=3DNONREF=01198=3DTWPTB0000061467=0111=3DF4714=01453=
=3D3=01448=3DFischer
>> Francis
>> Trees
>> &
>> Wat...@FF...=01447=3DC=01452=3D1=
1=01448=3DDLRWUS31=01447=3DB=01452=3D1=01
>> 17=3DTWPTB00000614671=0132=3D59730000.000000=0131=3D4.9070=01669=3D9=
9.291211110=01150=3DF=0139=3D2=01
> 54=3D1=01
>> 64=3D20061120=0155=3D[N/A]=0148=3D912795YN5=0122=3D1=01460=3D6=01167=
=3DTBILL=01541=3D20070111=01
225=3D20061012=01
>> 873=3D20060713=01107=3DB
>> 01/11/2007=0115=3DUSD=0138=3D59730000.000000=01423=3D4=016=3D99.2912=
11110=01
>> 381=3D59306640.40=01118=3D59306640.40=01151=3D0=0114=3D59730000.0000=
00=0130=3DTRWB=0175=3D20061115=01
>> 60=3D20061115-15:52:56=016616=3D20061115-15:51:03=0110=3D104=01
>>
>>
>>
>>
>>
>> Alvin Wang/FFTW
>>
>> 11/14/2006 08:01
> To
>> AM "quickfixj-users"
>>
> <qui...@li....
>> net>,
>>
> <qui...@li....
>> net>
>>
> cc
>>
>>
> Subject
>> Re: [Quickfixj-users]
>> quickfix.Message.toString()
>> NullPointerException
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> No. I did not compose a message. I use toString on a received messag=
e
>>
>>
>>
>>
>>
>> ----- Original Message -----
>> From: "Steve Bate" [st...@te...]
>> Sent: 11/14/2006 07:45 AM
>> To: <qui...@li...>
>> Subject: Re: [Quickfixj-users] quickfix.Message.toString()
>> NullPointerException
>>
>> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
>> QuickFIX/J Support: http://www.quickfixj.org/support/
>> If you set a field value to null, that would cause this exception.
>>
>> Steve
>>
>>> -----Original Message-----
>>> From: qui...@li... [mailto:quickfi=
xj-
>>> use...@li...] On Behalf Of Alvin Wang
>>> Sent: Monday, November 13, 2006 10:18 AM
>>> To: qui...@li...
>>> Cc: qui...@li...; quickfixj-users-
>>> bo...@li...
>>> Subject: [Quickfixj-users] quickfix.Message.toString()
>>> NullPointerException
>>>
>>> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
>>> QuickFIX/J Support: http://www.quickfixj.org/support/
>>> Hi,
>>>
>>> I got the following exception when I tried to run a toString() meth=
od
>>> on
>> a
>>> FIX44 Execution Report message.
>>> Could you take a look? thanks
>>>
>>> Alvin
>>>
>>> java.lang.NullPointerException
>>>
>>> at quickfix.FieldMap.calculateString(FieldMap.java:457)
>>>
>>> at quickfix.Message$Header.calculateString(Message.java:323)
>>>
>>> at quickfix.Message.toString(Message.java:132)
>>>
>>>
>>>
>>>
>>>
>>
>
***********************************************************************=
***
>>> *****
>>> This e-mail message is intended solely for the use of the addressee=
.
>>> The message may contain information that is privileged and
>>> confidential.
>>> Disclosure to anyone other than the intended recipient is prohibite=
d.
>>> If you are not the intended recipient, please do not disseminate,
>>> distribute or copy this communication, by e-mail or otherwise. Inst=
ead,
>>> please notify us immediately by return e-mail(including the origina=
l
>>> message with your reply) and then delete and discard all copies of =
the
>>> message. We have taken precautions to minimize the risk of
>>> transmitting
>>> software viruses but nevertheless advise you to carry out your own
>>> virus checks on any attachment to this message. We accept
>>> no liability for any loss or damage caused by software viruses.
>>>
>>
>
***********************************************************************=
***
>>> *****
>>>
>>>
>>>
>>>
> ---------------------------------------------------------------------=
----
>>> Using Tomcat but need to do more? Need to support web services,
>>> security?
>>> Get stuff done quickly with pre-integrated technology to make your =
job
>>> easier
>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>>>
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
>>> _______________________________________________
>>> Quickfixj-users mailing list
>>> Qui...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>>
>>
>>
>>
-----------------------------------------------------------------------=
--
>> Using Tomcat but need to do more? Need to support web services,
>> security?
>> Get stuff done quickly with pre-integrated technology to make your j=
ob
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&=
dat=3D121642
>> _______________________________________________
>> Quickfixj-users mailing list
>> Qui...@li...
>> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>>
>>
>>
>>
-----------------------------------------------------------------------=
--
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to sh=
are
>> your
>> opinions on IT & business topics through brief surveys - and earn ca=
sh
>>
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
>> _______________________________________________
>> Quickfixj-users mailing list
>> Qui...@li...
>> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>>
>
>
>
> ---------------------------------------------------------------------=
----
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to sha=
re
> your
> opinions on IT & business topics through brief surveys - and earn cas=
h
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CI=
D=3DDEVDEV
> _______________________________________________
> Quickfixj-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
>
>
> ---------------------------------------------------------------------=
----
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to sha=
re
> your
> opinions on IT & business topics through brief surveys - and earn cas=
h
> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CI=
D=3DDEVDEV
> _______________________________________________
> Quickfixj-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
-----------------------------------------------------------------------=
--
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share=
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
_______________________________________________
Quickfixj-users mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
=
|