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,
  • From Toli Kuznets... I have a basic app that uses QFJ to communicate. I have a bunch of uni tests running continiously, and they've been passing with the app linked to 1.0.0-final of QuickFix/J. However, as soon as i tried switching to 1.0.2 i get the following error: Exception in thread "QFJ Socket Acceptor 126f75b" java.lang.NullPointerException at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:131) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86) at java.lang.Thread.run(Unknown Source) There's no nested exception, and it's a thread created by QFJ and not my app. Switching the code back to using 1.0.0-final fixes the problem. I never used 1.0.1 so i can't tell if the problem manifests itself there as well. Any ideas on what could be causing this? This is happening both on Ubuntu Linux and MacOSX. Not even sure how to debug this since the exception is coming from a QFJ/mina code. ------------------------------------------------------------------------------------------------------------------------------- From Joerg Thoennes... Steve, the same happened to me. Today I got with version 1.0.1 this error: [2006-08-15 17:41:47,472] [INFO ] [quickfix.mina.acceptor.AcceptorIoHandler] (SocketAcceptor-0) MINA session created: /192.168.1.8:57611 [2006-08-15 17:41:47,573] [DEBUG] [FixLogFactory] (AnonymousIoService-1-2) FIX.4.2:FixGateway->FixClient: incoming: 8=FIX.4.2|9=62|35=5|34=1|49=FixClient|52=20060815-15:41:47.540|56=FixGateway|10=091| Exception in thread "QFJ Socket Acceptor 992bae" java.lang.NullPointerException at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:131) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86) at java.lang.Thread.run(Thread.java:595) If I can reproduce this error tomorrow, I will send you more details.
    via by Toli Kuznets,
  • In some cases the thread processing incoming FIX messages can get a NullPointerException accessing the ApplVerID if the Logon process is not complete, e.g. because the counter party did not answer with a Logon response but continues to send application messages. In real ife, this issue was observed as a counter party sent many FIX messages without noticing a FIX re-login: # counter party sends many messages # QF/J sends logout # counter party continues to send many messages # QF/J forces disconnect due to Logout time-out (no 35=5 received so far) # process restarts # QF/J creates a new session # QF/J sends Logon # counter party continues to send many messages (but no Logon) # QF/J receives a NPE for every message from the counter party: {code} [2012-11-08 14:44:26,644] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: outgoing: 8=FIX.4.4|9=68|35=A|34=1079|49=XXXAT|52=20121108-13:44:26.640|56=XXXFL|98=0|108=30|10=124| [2012-11-08 14:44:26,699] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=375|35=8|34=65834|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.675|56=XXXAT|122=20121108-12:45:47|6=0|... [2012-11-08 14:44:26,712] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : Initiated logon request [2012-11-08 14:44:26,801] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : null java.lang.NullPointerException at quickfix.MessageUtils.toBeginString(MessageUtils.java:256) at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62) at quickfix.Session.next(Session.java:913) at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94) at java.lang.Thread.run(Thread.java:722) [2012-11-08 14:44:26,802] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=353|35=8|34=65835|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.676|56=XXXAT|122=20121108-12:45:47|6=0|... [2012-11-08 14:44:26,811] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : null java.lang.NullPointerException at quickfix.MessageUtils.toBeginString(MessageUtils.java:256) at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62) at quickfix.Session.next(Session.java:913) at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94) at java.lang.Thread.run(Thread.java:722) {code}
    via by Jörg Thönnes,
  • In some cases the thread processing incoming FIX messages can get a NullPointerException accessing the ApplVerID if the Logon process is not complete, e.g. because the counter party did not answer with a Logon response but continues to send application messages. In real ife, this issue was observed as a counter party sent many FIX messages without noticing a FIX re-login: # counter party sends many messages # QF/J sends logout # counter party continues to send many messages # QF/J forces disconnect due to Logout time-out (no 35=5 received so far) # process restarts # QF/J creates a new session # QF/J sends Logon # counter party continues to send many messages (but no Logon) # QF/J receives a NPE for every message from the counter party: {code} [2012-11-08 14:44:26,644] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: outgoing: 8=FIX.4.4|9=68|35=A|34=1079|49=XXXAT|52=20121108-13:44:26.640|56=XXXFL|98=0|108=30|10=124| [2012-11-08 14:44:26,699] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=375|35=8|34=65834|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.675|56=XXXAT|122=20121108-12:45:47|6=0|... [2012-11-08 14:44:26,712] [QFJ Timer] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : Initiated logon request [2012-11-08 14:44:26,801] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : null java.lang.NullPointerException at quickfix.MessageUtils.toBeginString(MessageUtils.java:256) at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62) at quickfix.Session.next(Session.java:913) at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94) at java.lang.Thread.run(Thread.java:722) [2012-11-08 14:44:26,802] [SocketConnectorIoProcessor-0.0] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: incoming: 8=FIX.4.4|9=353|35=8|34=65835|43=Y|49=XXXFL|50=BU/XXXFL|52=20121108-13:44:26.676|56=XXXAT|122=20121108-12:45:47|6=0|... [2012-11-08 14:44:26,811] [QFJ Message Processor] FIX.4.4:XXXAT->XXXFL:TEST-XXX-XXXFL-YYY: event : null java.lang.NullPointerException at quickfix.MessageUtils.toBeginString(MessageUtils.java:256) at quickfix.DefaultDataDictionaryProvider.getApplicationDataDictionary(DefaultDataDictionaryProvider.java:62) at quickfix.Session.next(Session.java:913) at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94) at java.lang.Thread.run(Thread.java:722) {code}
    via by Jörg Thönnes,
  • From Toli Kuznets... I have a basic app that uses QFJ to communicate. I have a bunch of uni tests running continiously, and they've been passing with the app linked to 1.0.0-final of QuickFix/J. However, as soon as i tried switching to 1.0.2 i get the following error: Exception in thread "QFJ Socket Acceptor 126f75b" java.lang.NullPointerException at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:131) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86) at java.lang.Thread.run(Unknown Source) There's no nested exception, and it's a thread created by QFJ and not my app. Switching the code back to using 1.0.0-final fixes the problem. I never used 1.0.1 so i can't tell if the problem manifests itself there as well. Any ideas on what could be causing this? This is happening both on Ubuntu Linux and MacOSX. Not even sure how to debug this since the exception is coming from a QFJ/mina code. ------------------------------------------------------------------------------------------------------------------------------- From Joerg Thoennes... Steve, the same happened to me. Today I got with version 1.0.1 this error: [2006-08-15 17:41:47,472] [INFO ] [quickfix.mina.acceptor.AcceptorIoHandler] (SocketAcceptor-0) MINA session created: /192.168.1.8:57611 [2006-08-15 17:41:47,573] [DEBUG] [FixLogFactory] (AnonymousIoService-1-2) FIX.4.2:FixGateway->FixClient: incoming: 8=FIX.4.2|9=62|35=5|34=1|49=FixClient|52=20060815-15:41:47.540|56=FixGateway|10=091| Exception in thread "QFJ Socket Acceptor 992bae" java.lang.NullPointerException at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:131) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86) at java.lang.Thread.run(Thread.java:595) If I can reproduce this error tomorrow, I will send you more details.
    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,
  • 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.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:109) at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:70) at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:86) at java.lang.Thread.run(Thread.java:619)
    No Bugmate found.