Re: [Quickfix-developers] Java Exception reveals the problem with TAG 52
Brought to you by:
orenmnero
|
From: VP M. IT A. E. T. <ass...@gm...> - 2005-06-30 13:40:21
|
The config file for QF-J appears to be not the standard QF settings file.
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
[SESSION]
BeginString=3DFIX.4.2
SenderCompID=3DCTEST
TargetCompID=3DTTEST
---------
The java app. fails complaining about=20
quickfix.ConfigError: no initiators in settings
at quickfix.netty.AbstractSocketInitiator.initialize(AbstractSocket=
Initiator.java:178)
at quickfix.netty.AbstractSocketInitiator.start(AbstractSocketIniti=
ator.java:117)
at FixGwy.<init>(Unknown Source)
at FixGwy.main(Unknown Source)
----
If I remove=20
ConnectionType=3Dinitiator
the stack works fine.
FYI
--
Raman
IMHO: the same settings file should work. We should strive for that.
Except for loading the jni nothing else should be different.
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)=20
{
// boolean loaded =3D false;
if (!loaded) {
loaded =3D true;
try {System.loadLibrary("quickfix_jni");}=20
catch(UnsatisfiedLinkError e) {
loaded =3D false;
System.out.println("Could not load
quickfix_jni library" +
e.toString());
}
if ( loaded )=20
{
System.out.println("Loaded library quickfix_jni=
");
}
} // if !loaded
} // synchronized=20
} // static=20
} // class=20
------------------
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.
On 6/28/05, VP Marketing IT Asset Enterprise Technologies
<ass...@gm...> wrote:
> 52=3D20050628-18:27:49
>=20
> The solution however was simple...changed datadictionary=3DY to N
> and it worked fine after that.
>=20
>=20
> 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?QuickFixF=
AQ
> > 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 severel=
y
> > > 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 req=
uest)
> > > <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=3D2005=
0628-
> > > 18:27:49108=3D60141=3DN383=3D5600010=3D203)
> > > <20050628-18:28:04, FIX.4.2:FTEST->CTEST, event> (error while receivi=
ng
> > > 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(AbstractSocketI=
nitia
> > > tor.java:210)
> > > at quickfix.SocketInitiator.onMessage(SocketInitiator.java:94=
)
> > > at
> > > quickfix.netty.AbstractSocketInitiator$SessionConnection$NettySession=
Liste
> > > ner.messageReceived(AbstractSocketInitiator.java:380)
> > > at
> > > net.gleamynode.netty2.Session.fireMessageReceived(Session.java:733)
> > > at
> > > net.gleamynode.netty2.LowLatencyEventDispatcher.flush(LowLatencyEvent=
Dispa
> > > 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 req=
uest)
> > >
> > > 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 co=
rrect
> > > > the trouble earlier was with the settings file...
> > > >
> > > > The file is there. But there is only one session and that is with a=
n
> > > 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 b=
e
> > > > "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)))?c=
ode: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=3Dcl=
ick
> > _______________________________________________
> > Quickfix-developers mailing list
> > Qui...@li...
> > https://lists.sourceforge.net/lists/listinfo/quickfix-developers
> >
>
|