James Netherton created CAMEL-11465:
---------------------------------------
Summary: NPE caused by IrcMessage
Key: CAMEL-11465
URL: https://issues.apache.org/jira/browse/CAMEL-11465
Project: Camel
Issue Type: Bug
Components: camel-irc
Reporter: James Netherton
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:
{code}
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)
{code}
Seems there's now a dependency on the CamelContext in
[MessageSupport.setBody|https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/impl/MessageSupport.java#L122]
and the {{IrcMessage}} constructor calls {{setBody}} before the CamelContext
has been provided to it (it's currently set after the constructor is called).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)