0

I am writing a Java program with QuickFIX/J (version 1.6.0).

Everything works fine as long as I only logged to files.. Now, I wanted to add JDBC logging:

SessionSettings sessionSettings = null;

try {

    sessionSettings = new SessionSettings(pathToFixConfigFile);

    logger.info("Everything okay");
} catch (ConfigError e) {

    logger.error("Error: ", e);
    throw (e);
}

MessageStoreFactory messageStoreFactory = new JdbcStoreFactory(
sessionSettings);

LogFactory[] factorioes = { new FileLogFactory(sessionSettings),
new JdbcLogFactory(sessionSettings) };

LogFactory logFactory = new CompositeLogFactory(factorioes);

MessageFactory messageFactory = new DefaultMessageFactory();

try {

    socketInitiator = new SocketInitiator(xitaroApplication,
    messageStoreFactory, sessionSettings, logFactory,
    messageFactory);

} catch (ConfigError e) {

    logger.error("Error: ", e);
    throw (e);
}

and I get the following error:

quickfix.ConfigError: error during session initialization
    at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:168)
    at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators(AbstractSocketInitiator.java:83)
    at quickfix.SocketInitiator.initialize(SocketInitiator.java:114)
    at quickfix.SocketInitiator.start(SocketInitiator.java:89)
    at de.my.program.main(MyProgram.java:191)
Caused by: java.lang.NoClassDefFoundError: org/logicalcobwebs/cglib/proxy/Callback
    at org.logicalcobwebs.proxool.ConnectionPool.getConnection(ConnectionPool.java:261)
    at org.logicalcobwebs.proxool.ProxoolDataSource.getConnection(ProxoolDataSource.java:97)
    at quickfix.JdbcUtil.determineSessionIdSupport(JdbcUtil.java:127)
    at quickfix.JdbcLog.<init>(JdbcLog.java:88)
    at quickfix.JdbcLogFactory.create(JdbcLogFactory.java:38)
    at quickfix.CompositeLogFactory.create(CompositeLogFactory.java:55)
    at quickfix.Session.<init>(Session.java:460)
    at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:183)
    at quickfix.mina.SessionConnector.createSession(SessionConnector.java:141)
    at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:162)
    ... 4 more
Caused by: java.lang.ClassNotFoundException: org.logicalcobwebs.cglib.proxy.Callback
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 14 more

I have added all libs from QuickFIX to the classpath, but the error won't disappear :/

I know, that the my question is a bit clumsy.. But I am getting desperate and hope to getting help this way..

Thank you, guys!!

mrbela
  • 4,477
  • 9
  • 44
  • 79

3 Answers3

1

This issue is that the quickfix binary distribution is missing the proxool-cglib.jar file. When you specify the JDBC driver in your session settins file, quickfix automatically tries to create a connection pool using proxool. It relies on a class in the proxool-cglib.jar jar. To fix, just download the proxool-cglib.jar file and add it to your classpath. You can download it here: http://proxool.sourceforge.net/download.html

Han Tunca
  • 86
  • 3
0

You are obviously still missing some dependency. Your problem sounds a lot like this one where someone needed to also include the Apache Logging Commons jar file.

Community
  • 1
  • 1
jzapata
  • 1,229
  • 1
  • 12
  • 17
0

It will be easy if you use Intellij IDE. If you need I can give you a working project. :)

I think there must be issue in your POM file.check you dependencies. I think some libs are still missing.

FxMax
  • 472
  • 1
  • 5
  • 9