Announcement Announcement Module
Collapse
No announcement yet.
To address array must not be null Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • To address array must not be null

    Hi,

    I encountered this error when trying to send out an email using Spring Integration.

    I think the offending codes are below from MailSendingMessageHandler class.

    String[] to = this.retrieveHeaderValueAsStringArray(headers, MailHeaders.TO);
    mailMessage.setTo(to);

    My message does not contain the MailHeaders.TO. And when it tries to call the method mailMessage.setTo(), it will encounter the error. My application is setting the To email address from within the transformer itself before sending to mail outbound channel.

    Below is the stack trace.

    [2009-11-21 12:38:10.339] ageListenerContainer#0-1 WARN Execution of JMS message listener failed, and no ErrorHandler has been set. org.springframework.integration.message.MessageHan dlingException: error occurred in message handler [org.springframework.integration.transformer.Messag eTransformingHandler@36d54a44]
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:68)
    at org.springframework.integration.dispatcher.Broadca stingDispatcher.invokeHandler(BroadcastingDispatch er.java:119)
    at org.springframework.integration.dispatcher.Broadca stingDispatcher.dispatch(BroadcastingDispatcher.ja va:110)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:43)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:116)
    at org.springframework.integration.channel.MessageCha nnelTemplate.doSend(MessageChannelTemplate.java:22 2)
    at org.springframework.integration.channel.MessageCha nnelTemplate.send(MessageChannelTemplate.java:180)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendReplyMessage(Abstra ctReplyProducingMessageHandler.java:130)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:117)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:62)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :103)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 0)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:43)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:116)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:94)
    at org.springframework.integration.channel.MessageCha nnelTemplate.doSend(MessageChannelTemplate.java:22 3)
    at org.springframework.integration.channel.MessageCha nnelTemplate.send(MessageChannelTemplate.java:180)
    at org.springframework.integration.channel.MessageCha nnelTemplate.send(MessageChannelTemplate.java:168)
    at org.springframework.integration.jms.ChannelPublish ingJmsMessageListener.onMessage(ChannelPublishingJ msMessageListener.java:203)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.doInvokeListener(AbstractMessageLi stenerContainer.java:534)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.invokeListener(AbstractMessageList enerContainer.java:495)
    at org.springframework.jms.listener.AbstractMessageLi stenerContainer.doExecuteListener(AbstractMessageL istenerContainer.java:467)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.doReceiveAndExecute(Abstrac tPollingMessageListenerContainer.java:323)
    at org.springframework.jms.listener.AbstractPollingMe ssageListenerContainer.receiveAndExecute(AbstractP ollingMessageListenerContainer.java:261)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.invokeL istener(DefaultMessageListenerContainer.java:976)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.execute OngoingLoop(DefaultMessageListenerContainer.java:9 68)
    at org.springframework.jms.listener.DefaultMessageLis tenerContainer$AsyncMessageListenerInvoker.run(Def aultMessageListenerContainer.java:870)
    at java.lang.Thread.run(Thread.java:637)
    Caused by: java.lang.IllegalArgumentException: To address array must not be null
    at org.springframework.util.Assert.notNull(Assert.jav a:112)
    at org.springframework.mail.javamail.MimeMessageHelpe r.setTo(MimeMessageHelper.java:590)
    at org.springframework.mail.javamail.MimeMailMessage. setTo(MimeMailMessage.java:105)
    at org.springframework.integration.mail.MailSendingMe ssageHandler.applyHeadersToMailMessage(MailSending MessageHandler.java:130)
    at org.springframework.integration.mail.MailSendingMe ssageHandler.convertMessageToMailMessage(MailSendi ngMessageHandler.java:99)
    at org.springframework.integration.mail.MailSendingMe ssageHandler.handleMessage(MailSendingMessageHandl er.java:69)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :103)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 0)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:43)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:116)
    at org.springframework.integration.channel.MessageCha nnelTemplate.doSend(MessageChannelTemplate.java:22 2)
    at org.springframework.integration.channel.MessageCha nnelTemplate.send(MessageChannelTemplate.java:180)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.sendReplyMessage(Abstra ctReplyProducingMessageHandler.java:130)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:117)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:62)
    ... 27 common frames omitted
Working...
X