9 Replies Latest reply on Jun 2, 2010 1:21 PM by mwohlf

    Error sending email in jbpm-4.2

      Hi

       

      Currently I have a  problem, what happens is that I want to notify a user by e-mail that  has a task. I searched lot on the web but I can not  find the problem. I'm using jbpm-4.2 with  apache-tomcat-6.0

       

      Example process

       

        <start g="13,13,48,48" name="inicio">
              <transition to="enviar"/>
         </start>

       

        <mail g="274,755,86,40" name="enviar">
              <to addresses="carlosj@audifarma.com.co"/>
              <cc addresses="cmjhingeniero@yahoo.es"/>
              <subject>Prueba</subject>
              <text>Prueba</text>
              <transition to="despacho caf"/>
         </mail>
        
         <task candidate-groups="caf" form="com/procesos/interfaces/nCaf.jsp" g="352,695,92,52" name="despacho caf">
              <notification>
                  <to addresses="carlosj@audifarma.com.co"/>
                  <cc addresses="cmjhingeniero@yahoo.es"/>
                  <subject>Prueba 2</subject>
                  <text>Prueba 2</text>
              </notification>
              <transition to="fin"/>
         </task>

       

      <end g="1082,228,48,48" name="fin"/>

       

      Archive jbpm.cfg.xml

       

      <jbpm-configuration>

        <import resource="jbpm.default.cfg.xml" />
        <import resource="jbpm.businesscalendar.cfg.xml" />
        <import resource="jbpm.tx.hibernate.cfg.xml" />
        <import resource="jbpm.jpdl.cfg.xml" />
        <import resource="jbpm.identity.cfg.xml" />
        <import resource="jbpm.jobexecutor.cfg.xml" />
        <import resource="jbpm.mail.templates.examples.xml" />
        <string name='resource.mail.properties' value='jbpm.mail.properties' />
      </jbpm-configuration>

       

      Archive jbpm.mail.properties

       

      mail.smtp.host 10.1.1.20
      mail.smtp.port 25
      mail.from carlosj@audifarma.com.co

       

      Help me  not to review. Annex the error in the tomcat log

        • 1. Re: Error sending email in jbpm-4.2
          rebody

          Hi Carlos,

           

          I googled on net.  And somebody said that it could be caused by wrong version of email.  I suggest you try the mail.jar included in jBPM distribution.

          • 2. Re: Error sending email in jbpm-4.2

            Hi HuiSheng

             

            thanks  for responding in the classpath if you are activation.jar and mail.jar

            • 3. Re: Error sending email in jbpm-4.2

              I could not solve the  problem, so I consulted the web is in the configuration of tomcat. If anyone can help me I  appreciate it. I tried sending email  from a normal java method and I get the following error:

              javax.mail.NoSuchProviderException:  smtp

               

              Source  Code Java:

               

              public void send(){
                      MimeMultipart multipart = new MimeMultipart();
                      Properties properties = new Properties();
                      properties.put("mail.smtp.host", "10.1.1.20");
                      Session session = Session.getDefaultInstance(properties, null);
                      session.setDebug(true);
                      try {
                          MimeMessage msg = new MimeMessage(session);
                          msg.setFrom(new InternetAddress("carlosj@audifarma.com.co"));
                          msg.setRecipients(Message.RecipientType.TO, "cmjhingeniero@yahoo.es");
                          msg.setSubject("PROBANDO");
                          msg.setSentDate(new Date());
                          MimeBodyPart mbp = new MimeBodyPart();
                          mbp.setText("PROBANDO");
                          multipart.addBodyPart(mbp);
                          msg.setContent(multipart);
                          Transport t = session.getTransport("smtp");
                          t.connect();
                          Transport.send(msg);
                          t.close();
                          System.out.println("===>Correo Enviado...");
                      }
                      catch (Exception mex){
                          System.out.println("===>Error MailSender.send() = "+mex);
                      }
                  }

               

              Thanks

              • 4. Re: Error sending email in jbpm-4.2
                swiderski.maciej

                First of all please add :

                mail.debug set to true to mail properties:

                 

                Properties properties = new Properties();
                properties.put("mail.smtp.host", "10.1.1.20");
                properties.put("mail.debug", "true");
                

                that should print quite some information. Please attach the log file to the discussion.

                 

                What version of mail.jar are you using?

                • 5. Re: Error sending email in jbpm-4.2

                  Thanks  for responding. The mail.jar I'm using is the one who brings jbpm-4.2  package. Associate the image with the error found

                   

                  I appreciate any information that you can give me

                  • 6. Re: Error sending email in jbpm-4.2
                    swiderski.maciej

                    Could you describe a bit your environment setup?

                     

                    It seems like some class loader issues. Please make sure that jbpm and mail libraries are loaded by the same class loader.

                    • 7. Re: Error sending email in jbpm-4.2

                      I  installed the jbpm-4.2 package and install it on tomcat with  demo.setup.tomcat I check in the lib folder of apache-tomcat libraries  were the activation.jar and mail.jar Also in the lib folder of src-4.2  jbpm is the activation.jar and mail.jar libraries

                       

                      Thanks for your  help

                      • 8. Re: Error sending email in jbpm-4.2

                        I  updated the version of mail.jar to Tomcat 1.4.3 I have reinstalled with  reinstall.tomcat.and.jbpm but the error persists. I have found in a  different forum following the error I get:

                         

                        Forum Response:
                        "Undoubtedly  this is a configuration error in your production Tomcat server.
                        If you're  Including mail.jar in your web application Tomcat Then Most Likely
                        Also has a  version of mail.jar that's somehow Causing the problem. Possibly there's a  problem with the Tomcat ClassLoader That makes Used in
                        Unable to look it  up the file That resource providers configure the protocol "

                         

                        I do not know  what to check in the apache-tomcat.6.0.20
                        I have four days and I could not find the solution thank any  help

                         

                        Thanks

                        • 9. Re: Error sending email in jbpm-4.2
                          mwohlf

                          did you try removing the mail.jar & activation.jar from the tomcat/lib directory and just keep the ones in your application's lib directory?

                          and maybe you should give tomcat 6.0.26 a try