Problem in Notify Email
neha2911 Aug 27, 2008 7:37 AMI want to send an email to the user after the successful action pipeline is completed. I have used NotifyEmail for this but this is not working. The SMTP host is not picked up from the jboss-properties.xml .
The error is
2008-08-27 16:18:42,546 INFO [STDOUT] ConsoleNotifier 2008/08/27 04:18:42.546<<CountryDetais><Country Code="us"><Name>United States of America</Name><Rate>8.33</Rate><ISD>71</ISD> </Country><Country Code="in"><Name>India</Name><Rate>0</Rate> <ISD>91</ISD></Country><Country Code="au"><Name>Australia</Name><Rate>7.69</Rate><ISD>21</ISD></Country></CountryDetais>> 2008-08-27 16:18:42,562 WARN [org.jboss.soa.esb.helpers.Email] 'org.jboss.soa.esb.mail.smtp.auth' set to an empty value. 2008-08-27 16:18:42,562 INFO [org.jboss.soa.esb.helpers.Email] Initialising mail server sesson. Properties: {mail.smtp.port=25, mail.smtp.auth=true, mail.smtp.host=localhost} 2008-08-27 16:18:43,671 ERROR [org.jboss.soa.esb.notification.NotificationList] Can't instantiate target <target class="NotifyEmail" from="Neha.Pandey@lntinfotech.com" sendTo="Neha.Pandey@lntinfotech.com" subject="Hello"> </target> org.jboss.soa.esb.notification.NotificationException: javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset at org.jboss.soa.esb.notification.NotifyEmail.sendNotification(NotifyEmail.java:127) at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:164) at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processSuccess(ActionProcessorMethodInfo.java:165) at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(OverriddenActionLifecycleProcessor.java:108) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessingPipeline.java:610) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:384) at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: javax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412) at javax.mail.Service.connect(Service.java:310) at javax.mail.Service.connect(Service.java:169) at javax.mail.Service.connect(Service.java:118) at javax.mail.Transport.send0(Transport.java:188) at javax.mail.Transport.send(Transport.java:118) at org.jboss.soa.esb.helpers.Email.sendMessage(Email.java:181) at org.jboss.soa.esb.notification.NotifyEmail.sendEmailNotification(NotifyEmail.java:151) at org.jboss.soa.esb.notification.NotifyEmail.sendNotification(NotifyEmail.java:115) ... 14 more Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88) at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1589) ... 24 more
I have set the properties in Jboss-properties.xml file
<properties name="transports" depends="core"> <property name="org.jboss.soa.esb.mail.smtp.host" value="172.25.8.13"/> <property name="org.jboss.soa.esb.mail.smtp.user" value=""/> <property name="org.jboss.soa.esb.mail.smtp.password" value=""/> <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/> </properties>
My Jbossesb.xml is
<service category="QuickstartTransformCSV" name="SimpleListener" description="Hello World"> <listeners> <jms-listener name="CSVJMS-Gateway" busidref="quickstartCSVGwChannel" maxThreads="1" is-gateway="true"/> <jms-listener name="CSVquickstart" busidref="quickstartCSVEsbChannel" maxThreads="1" /> </listeners> <actions mep="OneWay"> <action class="org.jboss.soa.esb.actions.Notifier" name="notificationAction"> <property name="notification-details"> <NotificationList type="OK"> <target class="NotifyConsole"/> <target class="NotifyQueues"> <messageProp name="quickstart" value="Calculator_Response"/> <queue jndiName="queue/quickstart_log_Queue"/> </target> <target class="NotifyEmail" from="Neha.Pandey@lntinfotech.com" sendTo="Neha.Pandey@lntinfotech.com" subject="Hello"> </target> </NotificationList> </property> <property name="okMethod" value="notifyOK"/> <!--property name="exceptionMethod" value="notifyError"/--> </action> <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value="[transform_CSV2Smooks_Intermediate_format] Message before CVS to XML transformation" /> </action> <!-- Transform 1: CSV to XML... --> <action name="transform-from-csv" class="org.jboss.soa.esb.actions.converters.SmooksTransformer"> <property name="resource-config" value="/smooks-res.xml" /> <property name="from-type" value="text/csv:country-list" /> <property name="to-type" value="text/xml:smooks-country-xml" /> </action> <action name="print-after-csv-tranform" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value="[transform_CSV2Smooks_Intermediate_format] Message after CVS to XML transformation" /> </action> <!-- Transform 2: XML to XML... --> <action name="transform-smooksXml-to-canonicalXml" class="org.jboss.soa.esb.actions.converters.SmooksTransformer"> <property name="resource-config" value="/smooks-res.xml" /> <property name="from-type" value="text/xml:smooks-country-xml" /> <property name="to-type" value="text/xml:canonical-country-xml" /> </action> <action name="print-after-xml-transform" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value=">>>> Message after Smooks intermediate xml -> target xml : " /> </action> <!-- The next action is for Continuous Integration testing --> <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/> </actions> </service>
How should i go about this?Whta is the problem?