You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (Jira)" <ji...@apache.org> on 2026/05/16 08:45:00 UTC

[jira] [Updated] (OFBIZ-13388) sendInvoicePerEmail fails with MissingMethodException: invalid makeValidContext() call in InvoiceServicesScript.groovy

     [ https://issues.apache.org/jira/browse/OFBIZ-13388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux updated OFBIZ-13388:
------------------------------------
    Priority: Major  (was: Critical)

> sendInvoicePerEmail fails with MissingMethodException: invalid makeValidContext() call in InvoiceServicesScript.groovy
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13388
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13388
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Arashpreet Singh
>            Priority: Major
>
> **Summary**
> The `sendInvoicePerEmail` service in
> `component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceServicesScript.groovy`
> fails at runtime with a MissingMethodException because
> `DispatchContext.makeValidContext()` is invoked with a single Map argument,
> but no such overload exists. Valid signatures are:
>   - makeValidContext(String, String, Map)
>   - makeValidContext(ModelService, String, Map)
> **Steps to reproduce**
> 1. Trigger the `sendInvoicePerEmail` service (e.g. from the invoice screen's
>    "Send per Email" action, which runs it async via the JobQueue).
> 2. Observe the async job failure in the OFBiz log.
> **Expected behaviour**
> The invoice email is scheduled and sent via `sendMailFromScreen`.
> **Actual behaviour**
> Async job fails with:
>   groovy.lang.MissingMethodException: No signature of method:
>   org.apache.ofbiz.service.DispatchContext.makeValidContext() is applicable
>   for argument types: (LinkedHashMap)
> **Proposed fix**
> Use the 3-argument overload, passing the target service name and the IN mode:
>     Map emailParams = dispatcher.getDispatchContext()
>             .makeValidContext('sendMailFromScreen', 'IN', ctx)
> Patch attached.
> **Environment**
> OFBiz <your version/branch>, Groovy 5.0.0-alpha-11, JDK 17



--
This message was sent by Atlassian Jira
(v8.20.10#820010)