Details
Description
This is an obscure bug that only surfaces when you have the JdbcLogger configured, but it actually can't connect to the DB to log the message.
Stack Trace:
1:13:18,038 ERROR [main] quickfix.CompositeLog (CompositeLog.java:53) - null, c
ontinuing
java.lang.NullPointerException
at quickfix.LogUtil.logThrowable(LogUtil.java:54)
at quickfix.JdbcLog.insert(JdbcLog.java:70)
at quickfix.JdbcLog.onEvent(JdbcLog.java:43)
at quickfix.CompositeLog.onEvent(CompositeLog.java:79)
at quickfix.Session.<init>(Session.java:195)
at
Turns out the new session is only added to the list of sessions after this log message is printed so moving line 200 above line 195 fixes the issue and displays the right error message (which is the cause for the Log failure)
Here's the patch as well:
svn diff Session.java
Index: Session.java
===================================================================
— Session.java (revision 536)
+++ Session.java (working copy)
@@ -227,12 +227,12 @@
state.setInitiator(heartbeatInterval != 0);
state.setMessageStore(messageStoreFactory.create(sessionID));
this.messageFactory = messageFactory;
+ sessions.put(sessionID, this);
getLog().onEvent("Session " + this.sessionID + " schedule is " + sessionSchedule);
if (!checkSessionTime())
- sessions.put(sessionID, this);
application.onCreate(sessionID);
getLog().onEvent("Created session: " + sessionID);
} catch (IOException e) { @@ -1692,4 +1692,4 @@ }
-}
\ No newline at end of file
+}
Attachments
Issue Links
- is related to
-
QFJ-133 Return of bug 89 - session lookup causes an NPE if JdbcLog is miconfigured initially
- Closed