From: Attila-Mihaly B. <dif...@gm...> - 2014-09-03 11:08:19
|
Hello, I'm trying to use QuickFix to implement an exchange simulator which accepts sessions using multiple FIX versions (4.0, 4.1, etc). I build QuickFix from the Gihub sources using: mvn install I add a dependency on it using: <dependency> <groupId>org.quickfixj</groupId> <artifactId>quickfixj-all</artifactId> <version>1.6.0-SNAPSHOT</version> </dependency> However when I try to run it, it fails with the following error message: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: quickfix/fix41/NewOrderSingle.<init>(Lquickfix/field/ClOrdID;Lquickfix/field/HandlInst;Lquickfix/field/Symbol;Lquickfix/field/Side;Lquickfix/field/OrdType;)V @11: invokevirtual Reason: Type 'quickfix/field/HandlInst' (current frame, stack[1]) is not assignable to 'quickfix/StringField' Current Frame: bci: @11 flags: { } locals: { 'quickfix/fix41/NewOrderSingle', 'quickfix/field/ClOrdID', 'quickfix/field/HandlInst', 'quickfix/field/Symbol', 'quickfix/field/Side', 'quickfix/field/OrdType' } stack: { 'quickfix/fix41/NewOrderSingle', 'quickfix/field/HandlInst' } Bytecode: 0000000: 2ab7 0007 2a2b b600 082a 2cb6 0008 2a2d 0000010: b600 082a 1904 b600 082a 1905 b600 08b1 0000020: at quickfix.fix41.MessageFactory.create(MessageFactory.java:83) at quickfix.DefaultMessageFactory.create(DefaultMessageFactory.java:133) at quickfix.MessageUtils.parse(MessageUtils.java:112) >From what I understand this is because HandlInst is a subclass of StringField in FIX41 but it's a subclass of CharField in later versions. During compilation of the library the first one is used (hence the setField calls in quickfix/fix41/NewOrderSingle refer to setField(StringField)), but in the actual jar we have HandlInst derived from CharField, thus making the class loading fail. Any idea how this should be resolved? Has anyone used QuickFixJ with multiple FIX versions in parallel in the same application? Thank you, Attila Balazs |