java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • QuickFIX/J Jira
    via by Unknown author,
  • QuickFIX/J Jira
    via by Unknown author,
  • 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()) { getLog().onEvent("Session state is not current; resetting " + this.sessionID); reset(); } - 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 +}
    via by Toli Kuznets,
  • 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()) { getLog().onEvent("Session state is not current; resetting " + this.sessionID); reset(); } - 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 +}
    via by Toli Kuznets,
    • 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)
    No Bugmate found.