web stats
SMTP Sender on trunk - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2011, 04:04 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default SMTP Sender on trunk

I'm trying to send a simple e-mail with the new SMTP Sender channel on the trunk version. I try the "Test Mail" button and it works good, so I don't have connection problems.

When I deploy the channel, it throws me this error:

Code:
ERROR 2011-09-07 13:56:33,395 [qtp2793484-35] com.mirth.connect.server.controllers.MuleEngineController: Failed to configure outbound router.
java.lang.IllegalArgumentException: Cannot invoke com.mirth.connect.connectors.smtp.SmtpConnector.setAttachments on bean class 'class com.mirth.connect.connectors.smtp.SmtpConnector' - argument type mismatch - had objects of type "java.lang.String" but expected signature "java.util.List"
	at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2235)
	at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2151)
	at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1957)
	at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:2064)
	at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1017)
	at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:830)
	at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:433)
	at com.mirth.connect.server.controllers.MuleEngineController.registerConnector(MuleEngineController.java:728)
	at com.mirth.connect.server.controllers.MuleEngineController.configureOutboundRouter(MuleEngineController.java:540)
	at com.mirth.connect.server.controllers.MuleEngineController.registerChannel(MuleEngineController.java:358)
	at com.mirth.connect.server.controllers.MuleEngineController.deployChannels(MuleEngineController.java:212)
	at com.mirth.connect.server.servlets.EngineServlet.doPost(EngineServlet.java:60)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:47)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
	at org.eclipse.jetty.server.Server.handle(Server.java:352)
	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
	at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
	at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2170)
	... 34 more
I doesn't put any attachment on the mail, so I don't know why fails with an "empty list". I see on code, if i'm not wrong, that the attachment list is transformed with an XML parser to a HTML list, and this error says that Mirth expects a list type, not an String.

It's a bug? Any ideas?

Thanks
Reply With Quote
  #2  
Old 09-07-2011, 09:00 AM
geraldb geraldb is offline
Mirth Employee
 
Join Date: Aug 2006
Location: Irvine, CA
Posts: 314
geraldb is an unknown quantity at this point
Default

Bug should be resolved now. See:

http://www.mirthcorp.com/community/i...wse/MIRTH-1938
__________________
Gerald Bortis | Chief Information Officer | Mirth Corporation
Reply With Quote
  #3  
Old 09-08-2011, 12:02 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default

Thanks for resolving, but now it throws me another error...

Code:
[2011-09-08 09:57:29,565]  ERROR (org.mule.impl.DefaultComponentExceptionStrategy:95): Caught exception in Exception Strategy for: a1d58847-4b4d-4a2e-8e05-9c79d62e1d40: org.mule.umo.routing.RoutingException: Failed to route event via endpoint: null. Message payload is of type: com.mirth.connect.model.MessageObject
org.mule.umo.routing.RoutingException: Failed to route event via endpoint: null. Message payload is of type: com.mirth.connect.model.MessageObject
	at org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:84)
	at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:247)
	at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:209)
	at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:277)
	at org.mule.impl.MuleSession.sendEvent(MuleSession.java:201)
	at org.mule.routing.inbound.InboundMessageRouter.send(InboundMessageRouter.java:176)
	at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:143)
	at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:487)
	at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:266)
	at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:225)
	at com.mirth.connect.connectors.file.FileMessageReceiver.processFile(FileMessageReceiver.java:228)
	at com.mirth.connect.connectors.file.FileMessageReceiver.poll(FileMessageReceiver.java:118)
	at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:97)
	at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
	at java.lang.Thread.run(Unknown Source)Caused by: org.mule.umo.routing.CouldNotRouteOutboundMessageException: Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.mirth.connect.connectors.smtp.SmtpConnector@17b9f44, endpointUri=smtp://noop, transformer=Transformer{name='a1d58847-4b4d-4a2e-8e05-9c79d62e1d40_destination_1_transformer', returnClass=false, returnClass=false, sourceTypes=[]}, name='_smtpEndpoint#1509828859', type='sender', properties={}, transactionConfig=org.mule.impl.MuleTransactionConfig@c155dd, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: com.mirth.connect.model.MessageObject
	at org.mule.routing.outbound.FilteringMulticastingRouter.route(FilteringMulticastingRouter.java:72)
	at org.mule.routing.outbound.OutboundMessageRouter$1.doInTransaction(OutboundMessageRouter.java:78)
	at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:48)
	at org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:82)
	... 16 moreCaused by: org.mule.umo.provider.DispatchException: Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.mirth.connect.connectors.smtp.SmtpConnector@17b9f44, endpointUri=smtp://noop, transformer=Transformer{name='a1d58847-4b4d-4a2e-8e05-9c79d62e1d40_destination_1_transformer', returnClass=false, returnClass=false, sourceTypes=[]}, name='_smtpEndpoint#1509828859', type='sender', properties={}, transactionConfig=org.mule.impl.MuleTransactionConfig@c155dd, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: com.mirth.connect.model.MessageObject
	at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:177)
	at org.mule.impl.MuleSession.sendEvent(MuleSession.java:191)
	at org.mule.impl.MuleSession.sendEvent(MuleSession.java:130)
	at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:85)
	at org.mule.routing.outbound.FilteringMulticastingRouter.route(FilteringMulticastingRouter.java:54)
	... 19 moreCaused by: java.lang.NullPointerException
	at com.mirth.connect.connectors.smtp.SmtpMessageDispatcher.doDispatch(SmtpMessageDispatcher.java:105)
	at com.mirth.connect.connectors.smtp.SmtpMessageDispatcher.doSend(SmtpMessageDispatcher.java:185)
	at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:164)
	... 23 more
The test is a simple channel reading from a file, and sending some content to email.
It seems that Mirth cannot send the message to Destination SMTP Sender.

Thanks
Reply With Quote
  #4  
Old 09-08-2011, 12:15 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default

Debugging, I find that headers field on connector is null, and when executing this code,

Code:
for (Entry<String, String> header : connector.getHeaders().entrySet()) {
   email.addHeader(header.getKey(), header.getValue());
}
fails on connector.getHeaders().entrySet(). I don't know what headers do exactly, I supose that are protocol mail headers.

It's a bug too?

Thanks
Reply With Quote
  #5  
Old 09-08-2011, 11:30 AM
geraldb geraldb is offline
Mirth Employee
 
Join Date: Aug 2006
Location: Irvine, CA
Posts: 314
geraldb is an unknown quantity at this point
Default

Yep, was the same issue. Fixed in the trunk.
__________________
Gerald Bortis | Chief Information Officer | Mirth Corporation
Reply With Quote
  #6  
Old 09-08-2011, 11:05 PM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default

Gerald, I update the trunk, I create the channel from the beginning, and it still doing the same issue, headers are null.

If I put a condition checking if it's null, the rest of the code works good and the mail is sended.

Code:
if(connector.getHeaders()!=null) {
      for (Entry<String, String> header : connector.getHeaders().entrySet()) {
            email.addHeader(header.getKey(), header.getValue());
      }
}
But I know this is not the solution...
Reply With Quote
  #7  
Old 09-15-2011, 01:47 AM
mlizana mlizana is offline
Mirth Newb
 
Join Date: Jun 2011
Location: Mataró (Barcelona)
Posts: 24
mlizana is on a distinguished road
Default

Thanks! Solved
Reply With Quote
Reply

Tags
attachment, list, smtp, string, trunk

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:29 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation