RE: [Quickfix-developers] Java Exception reveals the problem with TAG 52
Brought to you by:
orenmnero
|
From: Steve B. <st...@te...> - 2005-06-30 18:25:06
|
Hi, Yes, I found the bug in the SessionFactory object. I've added a unit test for the problem and fixed it. The factory was defaulting to an initiator if the connection type was unspecified. The change should=20 be available in the anonymous CVS repository soon (if it's not=20 already there). Thanks for reporting this.=20 Steve > -----Original Message----- > From: qui...@li... = [mailto:quickfix- > dev...@li...] On Behalf Of VP Marketing IT = Asset > Enterprise Technologies > Sent: Thursday, June 30, 2005 8:40 AM > To: Steve Bate > Cc: qui...@li... > Subject: Re: [Quickfix-developers] Java Exception reveals the problem = with > TAG 52 >=20 > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX FAQ: = http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ > QuickFIX Support: http://www.quickfixengine.org/services.html >=20 > The config file for QF-J appears to be not the standard QF settings = file. >=20 > Here is an example: > [DEFAULT] > ConnectionType=3Dinitiator > HeartBtInt=3D30 > FileStorePath=3Dstore > StartTime=3D00:00:00 > EndTime=3D00:00:00 > UseDataDictionary=3DN > SocketConnectHost=3D0.0.0.0 > SocketConnectPort=3D7379 > ReconnectInterval=3D1 >=20 > [SESSION] > BeginString=3DFIX.4.2 > SenderCompID=3DCTEST > TargetCompID=3DTTEST >=20 > --------- > The java app. fails complaining about >=20 > quickfix.ConfigError: no initiators in settings > at > = quickfix.netty.AbstractSocketInitiator.initialize(AbstractSocketInitiator= . > java:178) > at > = quickfix.netty.AbstractSocketInitiator.start(AbstractSocketInitiator.java= : > 117) > at FixGwy.<init>(Unknown Source) > at FixGwy.main(Unknown Source) >=20 > ---- >=20 > If I remove >=20 > ConnectionType=3Dinitiator >=20 > the stack works fine. >=20 > FYI > -- > Raman >=20 > IMHO: the same settings file should work. We should strive for that. > Except for loading the jni nothing else should be different. >=20 >=20 > I have one class QuickfixLoader > -------- > public class QuickfixLoader { > static Object guard =3D new Object(); > static boolean loaded =3D false; > static public boolean isLoaded() { return loaded ; } > static { > synchronized (guard) > { > // boolean loaded =3D false; > if (!loaded) { > loaded =3D true; > try {System.loadLibrary("quickfix_jni");} > catch(UnsatisfiedLinkError e) { > loaded =3D false; > System.out.println("Could not load > quickfix_jni library" + > e.toString()); > } > if ( loaded ) > { > System.out.println("Loaded library > quickfix_jni"); > } > } // if !loaded > } // synchronized > } // static > } // class > ------------------ > and one line in my application... > //static { QuickfixLoader loader =3D new QuickfixLoader() ;} > ------------------ > Uncomment this line and build to create C++ based app. > Comment this line and build to create Pure Java based app. >=20 >=20 > On 6/28/05, VP Marketing IT Asset Enterprise Technologies > <ass...@gm...> wrote: > > 52=3D20050628-18:27:49 > > > > The solution however was simple...changed datadictionary=3DY to N > > and it worked fine after that. > > > > > > On 6/28/05, Steve Bate <st...@te...> wrote: > > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > > > QuickFIX FAQ: > http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ > > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > > Here is what I see happening > > > > F (my company) sends a 35=3DA to C the client > > > > Client sends 35=3DA > > > > QF does not like tag 52...do not know why yet... > > > > and it tries to reject that message before login occurs > > > > so an exception is thrown and then we know the rest... > > > > > > > > I guess the same thing happened yesterday with Quickfix. > > > > > > > > This is with QuickfixJ. > > > > > > Ah, a good compatibility test. ;-) > > > > > > What is the value of tag 52 in the logon response (assuming > > > the tag exists)? > > > > > > Steve > > > > > > > Oren, now I am going to do the cvs up command see if the updates > help > > > > me nudge along. > > > > ( I am guessing the CVS up is shorthand for CVS update...I am > severely > > > > handicapped with C++, CVS and windows) > > > > I hope am not being taken for high maintenance user > > > > -- > > > > RK > > > > > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, outgoing> > > > > (8=3DFIX.4.29=3D7135=3DA34=3D149=3DFTEST52=3D20050628- > > > > 18:28:04.33156=3DCTEST98=3D0108=3D3010=3D197) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, event> (Initiated = logon > request) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, outgoing> > > > > (8=3DFIX.4.29=3D7135=3DA34=3D149=3DFTEST52=3D20050628- > > > > 18:28:04.33156=3DCTEST98=3D0108=3D3010=3D197) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, incoming> > > > > = (8=3DFIX.4.29=3D8735=3DA49=3DCTEST56=3DFTEST34=3D0000198=3D052=3D20050628= - > > > > 18:27:49108=3D60141=3DN383=3D5600010=3D203) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, event> (error while > receiving > > > > message > > > > quickfix.SessionException: Tried to send a reject while not = logged > on: > > > > Tag specified out of required order (field 52) > > > > at quickfix.Session.generateReject(Session.java:753) > > > > at quickfix.Session.next(Session.java:508) > > > > at > > > > > = quickfix.netty.AbstractSocketInitiator.processMessage(AbstractSocketIniti= a > > > > tor.java:210) > > > > at > quickfix.SocketInitiator.onMessage(SocketInitiator.java:94) > > > > at > > > > > = quickfix.netty.AbstractSocketInitiator$SessionConnection$NettySessionList= e > > > > ner.messageReceived(AbstractSocketInitiator.java:380) > > > > at > > > > = net.gleamynode.netty2.Session.fireMessageReceived(Session.java:733) > > > > at > > > > > = net.gleamynode.netty2.LowLatencyEventDispatcher.flush(LowLatencyEventDisp= a > > > > tcher.java:67) > > > > at > > > > > = net.gleamynode.netty2.ReadController.processEvent(ReadController.java:360= ) > > > > at > net.gleamynode.netty2.IoProcessor.process(IoProcessor.java:334) > > > > at > > > > = net.gleamynode.netty2.IoProcessor.access$500(IoProcessor.java:73) > > > > at > > > > = net.gleamynode.netty2.IoProcessor$Worker.run(IoProcessor.java:364) > > > > ) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, event> (Dropped > Connection) > > > > FIX.4.2:FTEST->CTEST is LOGGED OUT <20050628-18:28:04, > > > > FIX.4.2:FTEST->CTEST, outgoing> > > > > (8=3DFIX.4.29=3D7135=3DA34=3D249=3DFTEST52=3D20050628- > > > > 18:28:04.63356=3DCTEST98=3D0108=3D3010=3D203) > > > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, event> (Initiated = logon > request) > > > > > > > > On 6/28/05, VP Marketing IT Asset Enterprise Technologies > > > > <ass...@gm...> wrote: > > > > > I switched to an executor in the LAN and it worked fine. You = are > correct > > > > > the trouble earlier was with the settings file... > > > > > > > > > > The file is there. But there is only one session and that is = with > an > > > > external > > > > > party and it could be failing for a number of reasons. > > > > > > > > > > The error (console) output did not indicate that. It = misdirects to > an > > > > > initiator not > > > > > being there. > > > > > > > > > > We can talk about how to structure a generic Error control and > > > > communication > > > > > exception hierarchy. > > > > > > > > > > Consider the following three classes: > > > > > > > > > > class QuickfixJErrorList > > > > > { > > > > > final String error_string[] =3D > > > > > { > > > > > "ILLEGAL ARGUMENT/INTERNAL ERROR", > > > > > "CONFIG FILE NOT READABLE", > > > > > "CONFIG NOT ACCORDING TO SPECIFICATION", // somethign simpler = may > be > > > > > "SESSION COULD NOT BE INITIALIZED", > > > > > > > > > > }; > > > > > final int base_error=3D1300; > > > > > final int error_no[] =3D {1300,1301,1302, 1303} ; // this = coudl be > > > > > base_error, base_error+1, etc > > > > > > > > > > static public String getErrorMessage(int code) { > > > > > return > > > > > = error_string[(code>base_error&&(code<(base_error+error_no.length)))?code:= 0 > > > > ); > > > > > } > > > > > static public String getErrorMessage(String code){ > > > > > try { > > > > > return getErrorMessage(Integer.parseInt(code.trim())); > > > > > } catch(Exception e) { } > > > > > return getErrorMessage(0); > > > > > } > > > > > } > > > > > class QuickfixException extends Exception > > > > > { > > > > > QuickfixException (String msgCode) > > > > > { > > > > > super(QuickfixJErrorList.getErrorMessage(msg); > > > > > } > > > > > } > > > > > > > > > > And we can implement the JErrorList in XML and load the DOM > > > > > or put it on HSQLDB or some such thing and manage it from > anywhere. > > > > > instead of being static class... > > > > > > > > > > I am hacking as I am writing this email.. the idea may be > clearer... > > > > > I can do this..if you send me a specification what you want. > > > > > -- > > > > > rk > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is sponsored by: Discover Easy Linux Migration = Strategies > > > from IBM. Find simple to follow Roadmaps, straightforward = articles, > > > informative Webcasts and more! Get everything you need to get up = to > > > speed, fast. = http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick > > > _______________________________________________ > > > Quickfix-developers mailing list > > > Qui...@li... > > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > > >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |