This discussion is archived
1 Reply Latest reply: Sep 9, 2013 5:35 PM by AbhishekJ RSS

SMTP host value being overwritten in OSB while sending emails

TarunRathor Newbie
Currently Being Moderated


I have two proxies within my OSB 11g project-

 

1. MailSender proxy- used to send emails to the customer. I am actually using Java code to send emails inside this message flow. The parameters to the java code are passed using DVMs.

 

2. Reprocessing proxy- polls another mailbox for undelivered/bounce back emails.

 

I have deployed this code in a clustered environment with 2 nodes hosting 2 JVMs (osb servers) each. The MailSender proxy is distributed on each JVM while Reprocessing proxy is(can be) targetted to only one JVM.

 

The issue I am facing is- whichever JVM this Reprocessing proxy is deployed on, that particular JVM is picking up localhost as the SMTP host (in MailSender proxy) - even though the server name is passed correctly.

 

Logs for MailSender proxy-

 

</dynamicValues>"

ServerName="smtp-server.qwerty.com"

fault="<con:fault xmlns:con="http://www.bea.com/wli/sb/context">

  <con:errorCode>BEA-382515</con:errorCode>

  <con:reason>Callout to java method "public static java.lang.String com.twc.sn.SendMail.callEmailService(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception" resulted in exception: Could not connect to SMTP host: localhost, port: 25

  1. javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;

  nested exception is:

        java.net.ConnectException: Connection refused

        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)

        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)

        at javax.mail.Service.connect(Service.java:288)

        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 com.twc.sn.SendMail.send(SendMail.java:69)

        at com.twc.sn.SendMail.callEmailService(SendMail.java:88)

        at sun.reflect.GeneratedMethodAccessor4529.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:183)

 

 

Please let me know if someone has faced this issue or knows a solution to this.

 

 

Regards,

Tarun

  • 1. Re: SMTP host value being overwritten in OSB while sending emails
    AbhishekJ Expert
    Currently Being Moderated

    Why are you not using an email transport business service to send the emails instead of using Java code in a proxy to send the emails? Create an SMTP server(which you should already have since you have the ReprocessingProxy which uses email transport) and define a business service of email transport using this SMTP server to send the emails.

     

    In case you have a valid reason to use custom Java code to send emails, in your java class first log the SMTP server you are receiving as input from Proxy (probably the value you are reading from the DVM) and check what is the value it prints in server log.

    Also log the input variables to the Java Callout before making the Java call in the proxy and see what are the values of input parameters and if they are correct.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points