Login  Register

Users - sendMailToRoles

Posted by Charles Johnson-4 on Apr 28, 2006; 12:13am
URL: http://ofbiz.116.s1.nabble.com/Users-sendMailToRoles-tp138731.html

Although my 'sendMailToRoles' service works, I'm getting the following
error:


Passed following params to 'sendMailToRoles'
[sendFrom=[hidden email], roles=[CTO], subject=Test to CTO at Thu Apr 2
7 23:21:40 BST 2006, body=Testing, locale=en_GB]
23:21:44,442 (org.ofbiz.service.job.JobPoller@135877f)
[XAConnectionFactory.java:119:WARN ] no xares in rms for con org.ofbi
z.minerva.pool.jdbc.xa.wrapper.XAConnectionImpl@14a9387
23:21:46,304 (Thread-35) [       ModelService.java:396:ERROR]
[ModelService.validate] : {sendMailToRoles} : (OUT) Required t
est error: org.ofbiz.service.ServiceValidationException: The following
required parameter is missing: [sendMailToRoles.body]
The following required parameter is missing: [sendMailToRoles.subject]
23:21:46,324 (Thread-35) [  ServiceDispatcher.java:366:ERROR]
---- exception report
----------------------------------------------------------
Outgoing result (in runSync : sendMailToRoles) does not match expected
requirements
Exception: org.ofbiz.service.ServiceValidationException
Message: The following required parameter is missing:
[sendMailToRoles.body]The following required parameter is missing: [se
ndMailToRoles.subject]
---- stack trace
---------------------------------------------------------------
org.ofbiz.service.ServiceValidationException: The following required
parameter is missing: [sendMailToRoles.body]The followi
ng required parameter is missing: [sendMailToRoles.subject]
org.ofbiz.service.ModelService.validate(ModelService.java:438)
org.ofbiz.service.ModelService.validate(ModelService.java:393)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:364)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:213)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:110)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

You can see from the above that the parameters *are* being passed (they
must be - i'm getting the mail ;-))

Could this be something to do with the fact that i'm calling sendMail in
this in a loop (don't knowif this is correct)?


            Iterator i = emailSet.iterator();
            while (i.hasNext()) {
                Map emailToSend = (Map) i.next();
                /*
                 * Merge the entries for each email to send with
                 * the original context parameters, allowing the
                 * latter to be overwritten
                 */
                context.putAll(emailToSend);
                EmailServices.sendMail(ctx, context);
    /*            if (bStoreEmailAsCommunication) {
                    EmailServices.storeEmailAsCommunication(ctx, context);
                }*/
            }


CJ
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users