Clarity

  • 1.  Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    Hello all,  I am developing a gel script that is very similar to the solution provided by Chris_Hackett in this thread:http://caforums.ca.com/t5/CA-Clarity-General-Discussion/GEL-email-address-and-NSA-email-server-settings/m-p/8751  It’s a gel script in a process that sends mails notifications to users who haven’t filled their timesheets.  It worked fine two weeks ago, but was put in draft mode waiting for customer validation.Now when I start the process I get this error:     BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:248:91: Unknown SMTP host: org.apache.commons.jelly.tags.sql.ResultImpl@18bf135 at org.apache.commons.jelly.tags.email.EmailTag.doTag(EmailTag.java:268) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:180) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595) Caused by: javax.mail.MessagingException: Unknown SMTP host: org.apache.commons.jelly.tags.sql.ResultImpl@18bf135; nested exception is: java.net.UnknownHostException: org.apache.commons.jelly.tags.sql.ResultImpl@18bf135 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) at         I’m using the tag instead of the tag in order to get:- the “ server â€? attribute : specify the smtp server, since our customer doesn’t want to use the regular smtp settings in NSA. The value is stored in a custom object instance, read from the database via an SLQ query and sent to the script.- the “ attach â€? attribute : to be able to get the log file (I’m writing with core:file into a log), it’s not critical but much more easier for us.  To do that I included xmlns:mail ="jelly:email" for the mail tag, along with xmlns:core and xmlns:sql   I checked a few things:- The application server can ping our smtp.- The same gel code works fine when launched through a cmd prompt (gel my_script.xml), from both the server and my machine. (just changed gel:out to gel:log,   switched the database connection)- I added some in different places of the code to make sure the value is correct (and it’s fine !), but the mail part gets an error.- I reduced the code in an example to send just one mail to myself, removing sql or other treatments but same error.- When hard coding the smtp url (smtp.server.com) or its IP address in gel script, always the same error.-->   as long as the script is launched through a process, it won’t succeed.  So I’m out of ideas or settings to check, would anyone get a piece of advice?  I’m thinking now that the might get called wrong or is not found, hence the error. Or some other settings changed since last time, I don’t see which ones.  As a workaround I could try the regular gel:mail method, but as I said our customer would rather not, and I don’t know what to set up in the NSA. I could let go the attached file though.  Thanks for any help you might bring.  We are using Clarity 8.1.3.4545, and it runs on a Windows 2003 server machine.  Jack


  • 2.  Re: Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    Hi Jack,           if you are using tag, the system automatically pick up the SMTP Server and send mail to SMTP Server. If you are using tag, system doesn't know the SMTP server IP until, mention the IP. You can mention the SMTP server at static or you can pick up the SMTP server IP from properties files.    Sample Gel script which is using to retrive the SMTP Hostname from Properties file.          

    SMTP Host Name : ${sn} SMTP Host Name :   ${sn} 
     This is test mail....
       ThanksSenthil.


  • 3.  Re: Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    **** Senthil,  Thank you for this solution but I still have the same error.  If I comment the mail part, the log shows the correct value read from the property file (I have'nt tried that until today, it works)But when I want to use the mail tag, I also get the same message:     BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:31:41: Unknown SMTP host: org.apache.commons.jelly.tags.sql.ResultImpl@18bf135 at   Same thing with url or IP address.  Is there any settings I might have left out in the NSA ?  Best regards,  Jack    


  • 4.  Re: Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    The error message suggests that there is nothing wrong with your script, as the error is coming from javax.mail, and is telling you what the problem is : unknown SMTP host, i.e:- the server name you are giving is wrong,- or the server is down or not running an SMTP service,  - or the server name is not being put in the server attribute of the email tag properly.    The next step is to find out which.  You can test the server name using  telnet servername.domain.com 25  Assuming you are running smtp on 25 like most people do.  Hope this helps.  Mark  


  • 5.  Re: Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    Thank you Mark.  Starting today everything is back to normal : the gel script works fine, with my first code or the gel properties method offered by Senthil.I don't know what changed, maybe on the smtp side, but this problem is solved.  Thanks again :smileywink:  Jack.


  • 6.  Re: Gel script : mail sending not working anymore

    Posted Oct 12, 2010 07:08 AM
    Hi Mark,  I have the same problem as Jack: I run your GEL script test from command line and it works and prints out the SMTP Host Name, but when it is run from a process it prints out an error:  BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:40:41: Could not connect to SMTP host: desclariapp, port: 25 at org.apache.commons.jelly.tags.email.EmailTag.doTag(EmailTag.java:268) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:183) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595) Caused by: javax.mail.MessagingException: Could not connect to SMTP host: desclariapp, port: 25; nested exception is: java.net.ConnectException: Connection refused at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) at javax.mail.Service.connect(Service.java:275) at javax.mail.Service.connect(Service.java:156) at javax.mail.Service.connect(Service.java:105) at javax.mail.Transport.send0(Transport.java:168) at javax.mail.Transport.send(Transport.java:98) at org.apache.commons.jelly.tags.email.EmailTag.doTag(EmailTag.java:265) ... 10 more Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250) ... 17 more Root cause javax.mail.MessagingException: Could not connect to SMTP host: desclariapp, port: 25; nested exception is: java.net.ConnectException: Connection refused at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370) at javax.mail.Service.connect(Service.java:275) at javax.mail.Service.connect(Service.java:156) at javax.mail.Service.connect(Service.java:105) at javax.mail.Transport.send0(Transport.java:168) at javax.mail.Transport.send(Transport.java:98) at org.apache.commons.jelly.tags.email.EmailTag.doTag(EmailTag.java:265) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:80) at com.niku.union.gel.GELController.invoke(GELController.java:20) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:183) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727) at java.lang.Thread.run(Thread.java:595) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at ...  What I have found out is that GEL script run from a process always gets the Clarity server as default, independently of the attrbiute 'server' value. However, if I run the GEL script from the command line, it gets the 'server' value I am specyfing...  Thanks,Alejandro.


  • 7.  Re: Gel script : mail sending not working anymore

    Posted Aug 25, 2016 07:08 AM

    On Aug 25 2016 the link to the post by Chris is

    GEL - email address and NSA email server settings