3

I am relatively new to FIX and this is my first time trying to connect. I am attempting to use the QuickFixJ library to connect to a UAT environment I have been provided with. Specifically I am using quickfixj-all-1.6.0.jar

I have implemented the sample code from here and it works up until socketAcceptor.start().

Here is the full code sample:

SocketAcceptor socketAcceptor = null;
   try {
       SessionSettings executorSettings = new SessionSettings(
               "quickFixTester/acceptorSettings.txt");
       Application application = new TestTradeAppExecutor();
       FileStoreFactory fileStoreFactory = new FileStoreFactory(
               executorSettings);
       MessageFactory messageFactory = new DefaultMessageFactory();
       FileLogFactory fileLogFactory = new FileLogFactory(executorSettings);
       socketAcceptor = new SocketAcceptor(application, fileStoreFactory,
               executorSettings, fileLogFactory, messageFactory);
       socketAcceptor.start();
   } catch (ConfigError e) {
       e.printStackTrace();
   }

The error i am getting is

2312 [main] INFO quickfix.SessionSchedule - [FIX.4.4:[SenderCompID]->[TargetCompID]] weekly, SUN 00:00:00-UTC - FRI 00:00:00-UTC
     Executor Session Created with SessionID = FIX.4.4:[SenderCompID]->[TargetCompID]
2327 [main] INFO quickfix.SocketAcceptor - SessionTimer started
2371 [main] INFO quickfix.mina.NetworkingOptions - Socket option: SocketTcpNoDelay=true
2371 [main] INFO quickfix.mina.NetworkingOptions - Socket option: SocketSynchronousWrites=false
2371 [main] INFO quickfix.mina.NetworkingOptions - Socket option: SocketSynchronousWriteTimeout=30000
Exception in thread "main" java.lang.NoSuchMethodError: quickfix.mina.message.FIXProtocolCodecFactory.addMessageDecoder(Ljava/lang/Class;)V
      at quickfix.mina.message.FIXProtocolCodecFactory.<init>(FIXProtocolCodecFactory.java:31)
      at quickfix.mina.acceptor.AbstractSocketAcceptor.startAcceptingConnections(AbstractSocketAcceptor.java:109)
      at quickfix.SocketAcceptor.initialize(SocketAcceptor.java:86)
      at quickfix.SocketAcceptor.start(SocketAcceptor.java:80)
      at quickFixTester.TestTradeAppExecutorApp.main(TestTradeAppExecutorApp.java:38)

The "SenderCompID->TargetCompID" variables are provided but have been removed from the sample here.

quickfix.mina.message.FIXProtocolCodecFactory.addMessageDecoder(Ljava/lang/Class;)V Is thrown within the socketAcceptor.start method. I cant see any cause for this as i have only changed the config examples to point towards the FIX UAT environment

I cannot understand why a method contained in the jar will throw this error, I am not trying to send a message at this stage only trying to open a connection. The example seems to have worked for others.

I get the exact same error using the FIX Client example found here as well

a.hrdie
  • 716
  • 2
  • 14
  • 35

2 Answers2

0

Have you referenced the mina-core jar as well? In the lib directory...

What about the mina SSL filter? Per my comment, a NoSuchMethodError for quickfix.mina implies a library is not referenced.

rupweb
  • 3,052
  • 1
  • 30
  • 57
  • Hi rupweb, yes I have added mina-core-2.0.9 into lib – a.hrdie Jun 05 '15 at 12:44
  • This should be more of a comment rather than an answer. – DumbCoder Jun 06 '15 at 17:42
  • yeah, though I thought it was the answer. I don't know the answer to this one... But a NoSuchMethodError in quickfix.mina implies a library is missing. – rupweb Jun 08 '15 at 08:12
  • 1
    Or it implies that the quickfix and mina library versions are no longer compatible - I saw this when having to use an older quickfix version with mina 2+, where some of these classes have been rewritten/refactored. Solution in my case was to use older mina as I had an older version of quickfixj with extensions done by a client. If you can, use a newer quickfixj version in stead. – nsandersen Nov 02 '18 at 09:15
0

Importing the second example as-is instead of trying to implement into my own Eclipse project worked. The problem appears to have been caused by using an incorrect import from the quickfix-all jar causing the wrong method to be called during start up.

a.hrdie
  • 716
  • 2
  • 14
  • 35
  • 1
    Can you please explain how you fixed this exactly. The accepted solution is meaningless to me and I have the same exact problem. – Michael Starkie Nov 05 '19 at 21:11
  • 1
    Hi, sorry it appears the link is now broken. I fixed this by copying code from the example line for line, including the pom dependencies. The reason for the error was commented above, the selected quickfix and mina library versions were no longer compatible.. if you have not already, try using the most recent QuickFIX and mina-core libraries. – a.hrdie Nov 06 '19 at 09:44
  • 2
    I solved it by using mina-core-2.1.3.jar with quickfixj-all-1.6.4.jar – Michael Starkie Nov 20 '19 at 19:25