[Quickfix-developers] Error sending new Order via Java
Brought to you by:
orenmnero
From: Java D. <jav...@ce...> - 2002-12-09 03:07:42
|
There's probably one simple thing I'm forgetting to set, but I cannot seem to get an order to go out via Java. I've taken the Banzai example (the Banzai client works fine) and used its code from my own app to send a new Order to the ordermatch engine, I get this error in my java console: java.lang.NullPointerException at org.quickfix.Message.setField(Unknown Source) at org.quickfix.fix42.NewOrderSingle.set(Unknown Source) at org.quickfix.fix42.NewOrderSingle.<init>(Unknown Source) at com.oms.fix.PublishFixOrder.send42(PublishFixOrder.java:128) at com.oms.fix.PublishFixOrder.send(PublishFixOrder.java:122) at com.oms.fix.OMSGWSubscriber.onMessage(OMSGWSubscriber.java:125) <20021209-02:55:25, FIX.4.2:TFLOOR1387->CNTR, incoming> =09 (8=3DFIX.4.2=019=3D54=0135=3D0=0134=3D52=0149=3DCNTR=0152=3D20021209-02:5= 5:25=0156=3DTFLOOR1387=0110 =3D030=01) <20021209-02:55:25, FIX.4.2:TFLOOR1387->CNTR, outgoing> =09 (8=3DFIX.4.2=019=3D54=0135=3D0=0134=3D52=0149=3DTFLOOR1387=0152=3D2002120= 9-02:55:25=0156=3DCNTR=0110 =3D030=01) <20021209-02:55:55, FIX.4.2:TFLOOR1387->CNTR, incoming> =09 (8=3DFIX.4.2=019=3D54=0135=3D0=0134=3D53=0149=3DCNTR=0152=3D20021209-02:5= 5:55=0156=3DTFLOOR1387=0110 =3D034=01) <20021209-02:55:55, FIX.4.2:TFLOOR1387->CNTR, outgoing> (8=3DFIX.4.2=019=3D54=0135=3D0=0134=3D53=0149=3DTFLOOR There's the usual QuickFIX logging in there, which tells me it's connected and logged on to the Ordermatch piece. Here's my code: I first call Application.send(Order), which will eventually end up here at this piece of code (taken from the Banzai example and put in my test app): public void send42(Order order) { =09 org.quickfix.fix42.NewOrderSingle newOrderSingle =3D new org.quickfix.fix42.NewOrderSingle( new ClOrdID(order.getID()), new HandlInst('1'), new Symbol(order.getSymbol()), sideToFIXSide(order.getSide()), new TransactTime(), typeToFIXType(order.getType())); newOrderSingle.set(new OrderQty(order.getQuantity())); send(populateOrder(order, newOrderSingle), order.getSessionID()); } This blows up and gives the above exception, never making it to the newOrderSingle.set() statement. I went and made sure that all the fields I knew about were set, here's the output from the debugger: avgPx=3D 0.0 canceled=3D false executed=3D 0 ID=3D "21" isNew=3D true limit=3D java.lang.Double (id=3D48) message=3D "from inet" open=3D 0 originalID=3D "1" quantity=3D 1000 rejected=3D false sessionID=3D org.quickfix.SessionID (id=3D66) side=3D com.oms.fix.OrderSide (id=3D53) stop=3D null suspended=3D false symbol=3D "sunw" tif=3D com.oms.fix.OrderTIF (id=3D56) type=3D com.oms.fix.OrderType (id=3D58) Any help would be appreciated, and please forgive me if this is a *basic* question, I'm still learning how to use QuickFix, and thanks to Oren and gang, this product is a tremendous help! -cedrick |