NullPointerException with MMSBufferAppender

Help
Natsuki
2011-07-07
2013-04-26
  • Natsuki

    Natsuki - 2011-07-07

    I haven't been able to get this to work, so I tried the Example code which suffers from the exact same problem. Here is the example code:

    Logger log = LoggerFactory.getLogger();
    MMSBufferAppender mmsAppender = new MMSBufferAppender();
    mmsAppender.setPriority(MMSBufferAppender.HIGH_PRIORITY);
    // Yes, you could use the MMS protocol to send an e-mail.
    mmsAppender.addAddress("<real email here>");
    log.addAppender(mmsAppender);
    log.setLevel(Level.DEBUG);
    log.info("Setup of log finished");
    log.debug("Message 1");
    log.debug("Testing a much longer message to see how it looks like.");
    log.error("This error message shall trigger sending an MMS message.");

    But this fails with an exception:
    Uncaught exception: java.lang.NullPointerException:   0
    at net.sf.microlog.midp.wma.MMSBufferAppender.sendLog(MMSBufferAppender.java:127)
    at net.sf.microlog.midp.wma.AbstractMessageAppender$1.run(AbstractMessageAppender.java:103)
    at java.lang.Thread.run(), bci=11

    Any ideas why?

     
  • Natsuki

    Natsuki - 2011-07-07

    Oh, and the error occurs on the final log.error line, in case that helps.

     

Log in to post a comment.