11 Replies Latest reply on Mar 2, 2011 6:40 AM by Rohit Wadke

    Email Problem with JBPM

    Ravi Sawlani Newbie

      Hi

       

      I am trying to send mail using org.jbpm.mail.Mail in a normal node using jBPM's own Mail(org.jbpm.mail.Mail) class as the handler.I get this exception:

      17:21:30,747 WARN  [Mail] cannot send mail (3 retries left): Could not connect to SMTP host: localhost, port: 25

      17:21:31,747 WARN  [Mail] cannot send mail (2 retries left): Could not connect to SMTP host: localhost, port: 25

      17:21:32,763 WARN  [Mail] cannot send mail (1 retries left): Could not connect to SMTP host: localhost, port: 25

      17:21:33,763 ERROR [SOAPFaultHelperJAXWS] SOAP request exception

      org.jbpm.JbpmException: cannot send email

      .

      .

      .

      .

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

        nested exception is:

          java.net.ConnectException: Connection refused: connect

      We have used jBPM version 3.2.2 with the Properties file which goes something like this:

      jbpm.mail.smtphost=xx.xx.xx.xx

      jbpm.mail.smtp.port=25

       

      We have made following entries in the jbpm.cfg.xml file:

      <string name="resource.mail.properties" value="jbpm.mail.properties"/>

       

      how can i send the mail from a particular IP address instead of  "localhost".

        • 1. Email Problem with JBPM
          helal jean-noel Newbie

          Looks like pvm do not find a smtp server at localhost/25 ...

          Not sure if you are using JBPM4 ou 5. In case JBPM 4 you can set some kind of "mail.properties" file into the classpath. Take a look into source code examples in JBPM 4.4, there is one.

           

          Regards

          jnh

          • 2. Email Problem with JBPM
            Ravi Sawlani Newbie

            Thanks for the reply jnh...

            We tried using properties file but its not picking host name from there... and also we are using jBPM version 3.2.2..

            Its still trying to file mails from localhost...

            • 3. Email Problem with JBPM
              Rohit Wadke Newbie

              Add mail properties file into WEB-INF, Add SMTP host name insted of localhost..

              • 4. Re: Email Problem with JBPM
                Ravi Sawlani Newbie

                Hi

                 

                Thanks For the reply....

                I have attached my JBPM Project structure.

                 

                jbpm.cfg.xml -->

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <jbpm-configuration>

                <string name="resource.mail.properties" value="jbpm.mail.properties"/>

                </jbpm-configuration>

                 

                jbpm.mail.properties -->

                 

                jbpm.mail.transport.protocol=smtp

                jbpm.mail.smtp.auth=false

                jbpm.mail.smtp.host=xx.xx.xx.xx

                jbpm.mail.smtp.port=25

                 

                processDefination.xml -->

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <process-definition name="todo">

                   <start-state name="start">

                  <transition to="mail-node1"></transition>

                </start-state>

                <mail-node name="mail-node1" to="xy@abc.com">

                  <subject>sss</subject>

                  <text>sss</text>

                  <transition to="done"></transition>

                </mail-node>

                <end-state name="done"/>

                </process-definition>

                 

                 

                Where will i make WEB-INF folder in my project?

                For exception please check my firt post in this thread........

                Please help me out with this....

                • 5. Email Problem with JBPM
                  Rohit Wadke Newbie

                  Make folder classes in WEB-INF add your mail properties, jbpm.cfg.xml, and process.jpdl file...

                   

                  Add following code in mail properties file...

                  mail.smtp.host yourhostname

                  mail.smtp.port 25

                  mail.smtp.auth false

                   

                  dont add mail session in jbpm.cfg.xml.

                   

                  its working for me...

                  • 6. Re: Email Problem with JBPM
                    Ravi Sawlani Newbie

                    Hi

                     

                    Thanks for your quick reply...

                     

                    In the above reply i have mentioned my jbpm.cfg.xml, jbpm.mail.properties and

                    processdefinition.xml content... please check

                     

                    my jbpm project structure is as follows-->

                    PorjectName

                         ->bin

                              ->com.sample

                              ->sample

                                   processdefination.xml

                         jbpm.cfg.xml

                         jbpm.mail.properties

                         ->src

                              ->main

                                   ->config

                                        jbpm.cfg.xml

                                       jbpm.mail.properties

                                   ->java

                                        ->com.sample

                                   ->jpld

                                        ->simple

                                             processdefinition.xml

                              ->test

                                   ->java

                                        ->com.sample

                         .classpath

                         .project

                     

                    Now Please let me know where should i keep my WEB-INF....

                    Also attached is my project package structure....

                    • 7. Re: Email Problem with JBPM
                      Rohit Wadke Newbie

                      how you call your process???

                      Do you have any UI part in project???

                      • 8. Re: Email Problem with JBPM
                        Rohit Wadke Newbie

                        I saw your package structure...

                        you can add folder in src

                         

                        src

                        ----main

                        ----test

                        ----classes

                         

                         

                        Put your all jpdl,conf,properties file in this folder it should work...

                        • 9. Email Problem with JBPM
                          Ravi Sawlani Newbie

                          We are using JBoss SOA App Server.... We deploy our jbpm project in the server and server provides UI for signalling the process....

                          • 10. Re: Email Problem with JBPM
                            Ravi Sawlani Newbie

                            Sorry NO LUCK....

                            Still getting the same error :-

                             

                            cannot send mail (3 retries left): Could not connect to SMTP host: localhost, port: 25

                             

                            How do u run your process... Could you please explain...

                             

                            • 11. Re: Email Problem with JBPM
                              Rohit Wadke Newbie

                              Ohhh   It seems your using old version on jBPM. I am using jBMP4.3 version.

                               

                              i saw your mail properties file which is

                               

                              jbpm.mail.transport.protocol=smtp

                              jbpm.mail.smtp.auth=false

                              jbpm.mail.smtp.host=xx.xx.xx.xx

                              jbpm.mail.smtp.port=25

                               

                              use this

                               

                              mail.smtp.host mail.YOURHOST.com

                              mail.smtp.port 25

                              mail.smtp.auth false

                               

                              Dont give = sign in this properties file..

                               

                              We are using process in ZK framwork so we have WEB_INF folder for UI part we keep all process file in that folder... its not neccessory actually..

                               

                              try given code