Uploaded image for project: 'Jahia Community'
  1. Jahia Community
  2. JAHIA-960

Erreur pour l'envoi de mail avec les workflows N-step

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • WCM 5.0
    • None
    • Windows - Postgresql - jahia5.0.0_CVS_r13907

    Description

      Lorsque je workflote avec un workflow N step, j'ai l'erreur suivante dans la log et je ne reçois aucun mail.

      Test réalisé sous Corporate Portal.

      1852203 [2006-04-13 15:56:34,812] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/engineName/workflow/op/edit/pid/37]
      user=[u1] ip=[127.0.0.1] in [687ms]
      1853484 [2006-04-13 15:56:36,093] [org.jahia.services.scheduler.BackgroundJob] INFO - execute Background job BackgroundJob-
      8a5e669d-4630-474a-86b1-e9a80cacbf5b
      started @ Thu Apr 13 15:56:36 CEST 2006
      1854359 [2006-04-13 15:56:36,968] [org.jahia.services.mail.MailServiceImpl] WARN - Couldn't send message
      org.springframework.mail.MailPreparationException: Could not prepare mail: startup failed, Script1.groovy: 1: expecting EOF,
      found '$' @ line 1, column 18.
      1 Error
      ; nested exception is org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: exp
      ecting EOF, found '$' @ line 1, column 18.
      1 Error

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 1: expecting EOF, found '$'
      @ line 1, column 18.
      1 Error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:325)
      at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:173)
      at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:143)
      at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:155)
      at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:379)
      at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:87)
      at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:276)
      at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:526)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:861)
      at org.codehaus.groovy.control.CompilationUnit.parse(CompilationUnit.java:513)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:441)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:300)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:555)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:567)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:542)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:520)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:496)
      at groovy.lang.Script.evaluate(Script.java:198)
      at gjdk.nstep_workflow_mailnotif_GroovyReflector.invoke(Unknown Source)
      at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
      at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:636)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:345)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:156)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
      at nstep_workflow_mailnotif.run(nstep_workflow_mailnotif.groovy:5)
      at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:428)
      at org.jahia.services.mail.GroovyMimeMessagePreparator.prepare(GroovyMimeMessagePreparator.java:34)
      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338)
      at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:330)
      at org.jahia.services.mail.MailServiceImpl.sendTemplateMessage(MailServiceImpl.java:198)
      at org.jahia.services.mail.MailServiceImpl$$FastClassByCGLIB$$10d0328.invoke(<generated>)
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:661)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:
      546)
      at org.jahia.services.mail.MailServiceImpl$$EnhancerByCGLIB$$6c64f1d9.sendTemplateMessage(<generated>)
      at org.jahia.workflow.nstep.NStepWorkflow.sendResults(NStepWorkflow.java:608)
      at org.jahia.services.workflow.ActivationJob.executeJahiaJob(ActivationJob.java:97)
      at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:101)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      1854391 [2006-04-13 15:56:37,000] [org.jahia.services.scheduler.BackgroundJob] INFO - Background job (of type workflow) end
      ed with status successful executed in 0s
      1861766 [2006-04-13 15:56:44,375] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/op/edit/pid/37] user=[u1] ip=[127.0.
      0.1] in [3657ms]
      1864984 [2006-04-13 15:56:47,593] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/engineName/logout/op/edit/pid/37] us
      er=[guest] ip=[127.0.0.1] in [547ms]
      1866219 [2006-04-13 15:56:48,828] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/engineName/login/pid/37] user=[guest
      ] ip=[127.0.0.1] in [0ms]
      1869687 [2006-04-13 15:56:52,296] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/engineName/login/pid/37] user=[u2] i
      p=[127.0.0.1] in [46ms]
      1870453 [2006-04-13 15:56:53,062] [org.jahia.bin.Jahia] INFO - Processed [/jahia/Jahia/pid/37] user=[u2] ip=[127.0.0.1] in
      [422ms]

      TestRail: Results

        Attachments

          Issue Links

            Activity

              [JAHIA-960] Erreur pour l'envoi de mail avec les workflows N-step

              Merci Cédric pour les informations.

              Le bug peut être fermer.

              xfetizon Xavier Fétizon added a comment - Merci Cédric pour les informations. Le bug peut être fermer.

              Xavier on peut fermer ce bug ?

              cedmail_old Cédric Mailleux (Inactive) added a comment - Xavier on peut fermer ce bug ?

              Xavier,

              excuse moi, le probleme viens de ta property subject.

              En fait l'objet mailINfo n'est accessible que pour le corps du message (tu peux regarder le fichier groovy dans WEB-INF/var/scripts/external_workflows/nstep_workflow_mailnotif.groovy

              vers la fin de ce fichier on itere sur les differents types de pages (finished, deleted, etc.) c'ets dans ces boucles que l'objet mailInfo est accessible pour les autres property (introduction et subject) voici la liste des variables (voir l'exemple de jahia):

              processingContext
              processName
              userName
              language
              pageTitleList

              cedmail_old Cédric Mailleux (Inactive) added a comment - Xavier, excuse moi, le probleme viens de ta property subject. En fait l'objet mailINfo n'est accessible que pour le corps du message (tu peux regarder le fichier groovy dans WEB-INF/var/scripts/external_workflows/nstep_workflow_mailnotif.groovy vers la fin de ce fichier on itere sur les differents types de pages (finished, deleted, etc.) c'ets dans ces boucles que l'objet mailInfo est accessible pour les autres property (introduction et subject) voici la liste des variables (voir l'exemple de jahia): processingContext processName userName language pageTitleList

              Bonjour Cédric,

              Je te remercie pour ta réponse.

              J'ai fait les modifications dans notre fichier nstep. (Je le joins au mail)
              Peux tu me dire ce que j'ai mal fait?

              J'ai toujours une erreur:

              Merci d'avance,
              Cordialement,

              Xavier
              Capgemini

              Erreur:
              193594 [2006-04-14 15:19:28,640] [org.jahia.services.scheduler.BackgroundJob] INFO - execute Background job BackgroundJob-3
              ba596a0-d9c0-4a2a-93e8-c751845a9d2e
              started @ Fri Apr 14 15:19:28 CEST 2006
              198250 [2006-04-14 15:19:33,296] [org.jahia.services.mail.MailServiceImpl] WARN - Couldn't send message
              org.springframework.mail.MailPreparationException: Could not prepare mail: No such property: mailInfo for class: Script1; ne
              sted exception is groovy.lang.MissingPropertyException: No such property: mailInfo for class: Script1
              groovy.lang.MissingPropertyException: No such property: mailInfo for class: Script1
              at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:730)
              at groovy.lang.GroovyObjectSupport.getProperty(GroovyObjectSupport.java:65)
              at groovy.lang.Script.getProperty(Script.java:84)
              at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getGroovyObjectProperty(ScriptBytecodeAdapter.java:365)
              at Script1.run(Script1.groovy:1)
              at groovy.lang.GroovyShell.evaluate(GroovyShell.java:521)
              at groovy.lang.GroovyShell.evaluate(GroovyShell.java:496)
              at groovy.lang.Script.evaluate(Script.java:198)
              at gjdk.nstep_workflow_mailnotif_GroovyReflector.invoke(Unknown Source)
              at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
              at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:636)
              at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:345)
              at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:156)
              at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
              at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
              at nstep_workflow_mailnotif.run(nstep_workflow_mailnotif.groovy:5)
              at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:428)
              at org.jahia.services.mail.GroovyMimeMessagePreparator.prepare(GroovyMimeMessagePreparator.java:34)
              at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338)
              at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:330)
              at org.jahia.services.mail.MailServiceImpl.sendTemplateMessage(MailServiceImpl.java:198)
              at org.jahia.services.mail.MailServiceImpl$$FastClassByCGLIB$$10d0328.invoke(<generated>)
              at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
              at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:661)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
              at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:
              546)
              at org.jahia.services.mail.MailServiceImpl$$EnhancerByCGLIB$$6c64f1d9.sendTemplateMessage(<generated>)
              at org.jahia.workflow.nstep.NStepWorkflow.sendResults(NStepWorkflow.java:608)
              at org.jahia.services.workflow.ActivationJob.executeJahiaJob(ActivationJob.java:97)
              at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:101)
              at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
              at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
              198500 [2006-04-14 15:19:33,546] [org.jahia.services.scheduler.BackgroundJob] INFO - Background job (of type workflow) ende
              d with status successful executed in 4s

              xfetizon Xavier Fétizon added a comment - Bonjour Cédric, Je te remercie pour ta réponse. J'ai fait les modifications dans notre fichier nstep. (Je le joins au mail) Peux tu me dire ce que j'ai mal fait? J'ai toujours une erreur: Merci d'avance, Cordialement, Xavier Capgemini Erreur: 193594 [2006-04-14 15:19:28,640] [org.jahia.services.scheduler.BackgroundJob] INFO - execute Background job BackgroundJob-3 ba596a0-d9c0-4a2a-93e8-c751845a9d2e started @ Fri Apr 14 15:19:28 CEST 2006 198250 [2006-04-14 15:19:33,296] [org.jahia.services.mail.MailServiceImpl] WARN - Couldn't send message org.springframework.mail.MailPreparationException: Could not prepare mail: No such property: mailInfo for class: Script1; ne sted exception is groovy.lang.MissingPropertyException: No such property: mailInfo for class: Script1 groovy.lang.MissingPropertyException: No such property: mailInfo for class: Script1 at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:730) at groovy.lang.GroovyObjectSupport.getProperty(GroovyObjectSupport.java:65) at groovy.lang.Script.getProperty(Script.java:84) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getGroovyObjectProperty(ScriptBytecodeAdapter.java:365) at Script1.run(Script1.groovy:1) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:521) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:496) at groovy.lang.Script.evaluate(Script.java:198) at gjdk.nstep_workflow_mailnotif_GroovyReflector.invoke(Unknown Source) at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:636) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:345) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:156) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85) at nstep_workflow_mailnotif.run(nstep_workflow_mailnotif.groovy:5) at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:428) at org.jahia.services.mail.GroovyMimeMessagePreparator.prepare(GroovyMimeMessagePreparator.java:34) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338) at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:330) at org.jahia.services.mail.MailServiceImpl.sendTemplateMessage(MailServiceImpl.java:198) at org.jahia.services.mail.MailServiceImpl$$FastClassByCGLIB$$10d0328.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:661) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java: 546) at org.jahia.services.mail.MailServiceImpl$$EnhancerByCGLIB$$6c64f1d9.sendTemplateMessage(<generated>) at org.jahia.workflow.nstep.NStepWorkflow.sendResults(NStepWorkflow.java:608) at org.jahia.services.workflow.ActivationJob.executeJahiaJob(ActivationJob.java:97) at org.jahia.services.scheduler.BackgroundJob.execute(BackgroundJob.java:101) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) 198500 [2006-04-14 15:19:33,546] [org.jahia.services.scheduler.BackgroundJob] INFO - Background job (of type workflow) ende d with status successful executed in 4s

              Xavier,

              toutes les entrees du fichier nstep_workflow.properties ont ete modifier pour repondre au nouveau systeme d'envoie de mail.

              il y a deux facons d'ecrire les proprietes maintenant :

              process.three_validation_step_workflow.mail.subject = "[JAHIA] Workflow " + processName + " modification par l'utilisateur " userName" sur la/les page(s) "+pageTitleList

              Ici, on concatene des chaines de caractere et des variables comme on le ferais en java.

              Autre methode :

              process.three_validation_step_workflow.mail.body.rollback = """La modification sur la page \"${mailInfo.getDisplayName()}\" a été refusée.\nRetour à l'étape \"${mailInfo.getCurrentStepLabel()}\"\nLien vers la page : PageLink"""

              Cette facon d'ecrire est specifique a groovy (en fait les chaines sont maintenant interpreter comme des srcipts groovy)

              cette methode d'ecriture permet d'ajouter des \n dans les constantes de caracteres, pour acceder a une variable il faut faire ${} (comme on le faisait avant), c'ets ici qu'apparais la variable mailInfo qui est un bean de type org.jahia.workflow.nstep.MailInfo (le mot PageLink est un mot clé qui sera remplacer par l'url directement dans le textBody ou par un lien dans le htmBody.

              Voila,

              A toi de jouer

              cedmail_old Cédric Mailleux (Inactive) added a comment - Xavier, toutes les entrees du fichier nstep_workflow.properties ont ete modifier pour repondre au nouveau systeme d'envoie de mail. il y a deux facons d'ecrire les proprietes maintenant : process.three_validation_step_workflow.mail.subject = " [JAHIA] Workflow " + processName + " modification par l'utilisateur " userName " sur la/les page(s) "+pageTitleList Ici, on concatene des chaines de caractere et des variables comme on le ferais en java. Autre methode : process.three_validation_step_workflow.mail.body.rollback = """La modification sur la page \"${mailInfo.getDisplayName()}\" a été refusée.\nRetour à l'étape \"${mailInfo.getCurrentStepLabel()}\"\nLien vers la page : PageLink""" Cette facon d'ecrire est specifique a groovy (en fait les chaines sont maintenant interpreter comme des srcipts groovy) cette methode d'ecriture permet d'ajouter des \n dans les constantes de caracteres, pour acceder a une variable il faut faire ${} (comme on le faisait avant), c'ets ici qu'apparais la variable mailInfo qui est un bean de type org.jahia.workflow.nstep.MailInfo (le mot PageLink est un mot clé qui sera remplacer par l'url directement dans le textBody ou par un lien dans le htmBody. Voila, A toi de jouer

              Bonjour Cédric,

              Le bug c'est produit avec nos propres worflows. J'ai ajouté les nouvelles lignes dans le fichier nstep-workflowResources.properties à savoir:

              notification.elements.rollbacked = Liste des éléments ayant reculé d'une étape :
              notification.elements.rollbacked.to.author = Liste des éléments étant retourné à la première étape :
              notification.elements.advanced = Liste des éléments ayant avancé d'une étape :
              notification.elements.finished = Liste des éléments venant d'être publié :
              notification.elements.deleted = Liste des éléments ayant été supprimer :

              process.workflow_1.mail.body.introduction="[JAHIA] Workflow "processName" résumé des actions de l'utilisateur "userName" dans la langue "+language
              process.workflow_1.notification.template.path=external_workflows/nstep_workflow_mailnotif.groovy

              Peux tu m'indiquer où il faut rajouter les """ en début et fin de chaines ?
              De plus, je n'ai pas trouvé l'objet MailInfo, peux tu m'indiquer où il se trouve et les modifs à appliquer.

              Merci d'avance,
              Cordialement,

              Xavier

              xfetizon Xavier Fétizon added a comment - Bonjour Cédric, Le bug c'est produit avec nos propres worflows. J'ai ajouté les nouvelles lignes dans le fichier nstep-workflowResources.properties à savoir: notification.elements.rollbacked = Liste des éléments ayant reculé d'une étape : notification.elements.rollbacked.to.author = Liste des éléments étant retourné à la première étape : notification.elements.advanced = Liste des éléments ayant avancé d'une étape : notification.elements.finished = Liste des éléments venant d'être publié : notification.elements.deleted = Liste des éléments ayant été supprimer : process.workflow_1.mail.body.introduction=" [JAHIA] Workflow " processName " résumé des actions de l'utilisateur " userName " dans la langue "+language process.workflow_1.notification.template.path=external_workflows/nstep_workflow_mailnotif.groovy Peux tu m'indiquer où il faut rajouter les """ en début et fin de chaines ? De plus, je n'ai pas trouvé l'objet MailInfo, peux tu m'indiquer où il se trouve et les modifs à appliquer. Merci d'avance, Cordialement, Xavier

              Xavier, le bug c'est produit avec le workflow nstep par defaut de jahia ou avec vos propres workflows ?

              Si c'ets avec vos workflows, il y a quelques modifications a apporter aux fichier des properties (il faut rajouter des """ en debut et en fin de chaine), de plus les variables osnt maintenant stocker dans un objet MailInfo.

              EN fait il faut regarder l'exemple fourni et appliquer les modifications a vos entrees de properties.

              cedmail_old Cédric Mailleux (Inactive) added a comment - Xavier, le bug c'est produit avec le workflow nstep par defaut de jahia ou avec vos propres workflows ? Si c'ets avec vos workflows, il y a quelques modifications a apporter aux fichier des properties (il faut rajouter des """ en debut et en fin de chaine), de plus les variables osnt maintenant stocker dans un objet MailInfo. EN fait il faut regarder l'exemple fourni et appliquer les modifications a vos entrees de properties.

              People

                cedmail_old Cédric Mailleux (Inactive)
                xfetizon Xavier Fétizon
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases

                      Packages

                        Version Package