Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11465

NPE caused by IrcMessage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.20.0
    • 2.20.0
    • camel-irc
    • None
    • Unknown

    Description

      The IrcEndpoint has a number of methods like createOnPrivmsgExchange, createOnNickExchange etc, where an instance of IrcMessage is created. When the constructor is called, it results in:

      16:49:55,426 ERROR [stderr] (Thread-97) Exception in thread "Thread-97" java.lang.NullPointerException
      16:49:55,427 ERROR [stderr] (Thread-97) 	at org.apache.camel.impl.MessageSupport.setBody(MessageSupport.java:122)
      16:49:55,427 ERROR [stderr] (Thread-97) 	at org.apache.camel.component.irc.IrcMessage.<init>(IrcMessage.java:50)
      16:49:55,427 ERROR [stderr] (Thread-97) 	at org.apache.camel.component.irc.IrcEndpoint.createOnPrivmsgExchange(IrcEndpoint.java:71)
      16:49:55,427 ERROR [stderr] (Thread-97) 	at org.apache.camel.component.irc.IrcConsumer$FilteredIRCEventAdapter.onPrivmsg(IrcConsumer.java:203)
      16:49:55,427 ERROR [stderr] (Thread-97) 	at org.schwering.irc.lib.IRCConnection.get(IRCConnection.java:430)
      16:49:55,428 ERROR [stderr] (Thread-97) 	at org.schwering.irc.lib.IRCConnection.run(IRCConnection.java:373)
      

      Seems there's now a dependency on the CamelContext in MessageSupport.setBody and the IrcMessage constructor calls setBody before the CamelContext has been provided to it (it's currently set after the constructor is called).

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jamesnetherton James Netherton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: