2

I am attempting to write a class for converting domain POJO's into QuickFixJ messages. When I try to create a new order message as so:

quickfix.fix44.NewOrderSingle order = new quickfix.fix44.NewOrderSingle();

The following exception is thrown in the logs:

Exception Details:
Location:
  quickfix/fix44/NewOrderSingle.get(Lquickfix/field/SettlType;)Lquickfix/field/SettlType; @2: invokevirtual
Reason:
Type 'quickfix/field/SettlType' (current frame, stack[1]) is not assignable to 'quickfix/CharField'
Current Frame:
  bci: @2
  flags: { }
  locals: { 'quickfix/fix44/NewOrderSingle', 'quickfix/field/SettlType' }
  stack: { 'quickfix/fix44/NewOrderSingle', 'quickfix/field/SettlType' }
Bytecode:
  0000000: 2a2b b600 3057 2bb0                    

It seems this error happens when attempting to merge two versions of Fix Message Fields together but as far as I know I am not doing this. I am using the same code as found in the QuickFixJ unit tests A variation of the same code works in this example, it is after a connection is applied through the initiator object. I am using the apache.servicemix.bundles.quickfix instead of the QuickFix-all.jar because it contains some fields i need to add to other messages.

I am unsure why I am not able to call a simple constructor of an object. The constructor in the jar is as follows:

public NewOrderSingle()
{
   getHeader().setField(new MsgType("D"));
}

Is there another possible cause for this error I havent thought of? I am stumped

a.hrdie
  • 716
  • 2
  • 14
  • 35
  • This could be helpful: http://stackoverflow.com/questions/29967804/quickfix-j-mixing-two-different-versions – shargors Aug 13 '15 at 14:10
  • Thanks for the suggestion, I had checked out this question earlier. It is the same error, but I am not trying to merge two FIX message versions together. All I am trying to do is create an object of type fix44.message but I cant call the constructor without this error being thrown. I have imported the required dependencies from the sample project which is working. I just cant figure out what is causing the exception – a.hrdie Aug 13 '15 at 17:53

1 Answers1

2

I had this problem and had to revert to QuickFIX 1.5.2

quickfixj message factory produces bad type on operand stack using qf 1.6.0 and java 1.8.0_45

It's a known issue according to the user group. See the attached question...

Community
  • 1
  • 1
rupweb
  • 3,052
  • 1
  • 30
  • 57