You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Carsten Heinrigs <ca...@cahein.de> on 2026/08/31 14:44:45 UTC
invoice printing problem
Hello Everyone,
we used to be able to print Invoices, but after an upgrade to 24.09.07
we get an error trying to generate a PDF. The variables 'templateName'
and 'templateLocation' cannot be resoved:
applications/accounting/widget/AccountingPrintScreens.xml
2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |ModelScreenWidget
|D| Rendering screen InvoicePDF; widget class is
org.apache.ofbiz.widget.model.ModelScreenWidget$IncludeScreen
2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
|D| Error evaluating expression ${templateName}:
javax.el.PropertyNotFoundException: Cannot resolve identifier
'templateName'
2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
|D| Error evaluating expression ${templateName}:
javax.el.PropertyNotFoundException: Cannot resolve identifier
'templateName'
2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
|D| Error evaluating expression ${templateLocation}:
javax.el.PropertyNotFoundException: Cannot resolve identifier
'templateLocation'
2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |ModelScreenWidget
|D| In the include-screen tag the screen name was empty, ignoring
include; in screen [InvoicePDF]
2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |TransactionUtil
|D| Current status : Transaction Active (0)
2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |TransactionUtil
|D| Transaction committed
2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |ScreenFopViewHandler
|D| XSL:FO Screen Output: <?xml version="1.0" encoding="UTF-8"?>
2026-08-31 16:34:40,247 |jsse-nio-8443-exec-3 |ApacheFopWorker
|I| FOP FontBaseURL: file:/home/cahein/projects/Pahema/ofbiz/pahema-
ofbiz/framework/webapp/config/
2026-08-31 16:34:42,990 |jsse-nio-8443-exec-3 |ApacheFopWorker
|W| TransformerFactory does not support ACCESS_EXTERNAL_* attributes:
Unrecognized configuration feature:
http://javax.xml.XMLConstants/property/accessExternalDTD
2026-08-31 16:34:43,029 |jsse-nio-8443-exec-3 |ScreenFopViewHandler
|E| Unable to transform FO file: org.apache.fop.apps.FOPException:
net.sf.saxon.trans.XPathException:
org.apache.fop.fo.ValidationException: Document is empty (something
might be wrong with your XSLT stylesheet).
net.sf.saxon.trans.XPathException:
org.apache.fop.fo.ValidationException: Document is empty (something
might be wrong with your XSLT stylesheet).; Screen XSL:FO text was:
<?xml version="1.0" encoding="UTF-8"?>
Any help would be greatly appreciated.
Thanks for your attention,
Carsten
--
Carsten Heinrigs
Software Beratung und Entwicklung
Telefon: 042116767790
Am Dobben 33
28203 Bremen
Germany
https://cahein.de
Finanzamt Bremen, Steuernummer 60 228 10721
Re: invoice printing problem
Posted by Aditi Patel <ad...@hotwax.co>.
Hi Carsten,
Glad it is working, and thank you for coming back with the answer - that
is the part that will help the next person who hits this.
Your fix lines up exactly with your upgrade window. From
dependencies.gradle:
24.09.05 org.codehaus.groovy:groovy-all:3.0.21
24.09.06 org.codehaus.groovy:groovy-all:3.0.25
24.09.07 org.codehaus.groovy:groovy-all:3.0.25
The bump landed in 24.09.06 (commit 3c49c448d7, a bulk dependency update),
i.e. right between the two versions you moved across. So a build still
carrying the older Groovy was running 24.09.07 screen code against 3.0.21.
That fits the symptom precisely. The <actions> block of InvoicePDF runs
DocTypeTemplate.groovy, whose last two lines are simply
context.templateLocation = ...
context.templateName = ...
With the mismatched Groovy those assignments never took effect - no
exception, no stack trace, just two context variables that were never set.
Hence "Cannot resolve identifier", the skipped include-screen, and the
empty FO document.
The practical lesson, which may be worth others knowing: when upgrading
within the 24.09 line, do a clean rebuild rather than an incremental one.
A stale Groovy on the classpath fails silently here.
And apologies for my first answer - the PartyPrefDocTypeTpl theory was
wrong for your case, as you rightly found.
On the PropertyNotFoundException noise, I do not think it warrants worry.
I checked against a healthy 24.09.07 that rendered a correct invoice PDF:
that single request logged 29 of them, all for optional variables -
successMessage, successMessageList, errorMessage, errorMessageList,
errorMessageMap, error_list, altPermission, uiLabelMap
These are the routine "is there a message to display?" probes. OFBiz's EL
layer cannot distinguish "this key is absent" from "this key is present but
null", so every optional lookup that comes back empty is reported this way.
They only matter when the name in the message is something the screen
actually needs - as templateName was for you. They are logged at
verbose/debug, so raising the level for org.apache.ofbiz.base.util.string
quiets them if they are in the way.
Best regards,
Aditi
On Tue, Sep 01, 2026 07:40 PM, Carsten Heinrigs <ca...@cahein.de> wrote:
> Invoice PDF-generation works after rebuilding with groovy 3.0.25.
>
> Still get lots of javax.el.PropertyNotFoundException, which makes me
> nervous.
>
RE: RE: Re: invoice printing problem
Posted by Carsten Heinrigs <ca...@cahein.de>.
Invoice PDF-generation works after rebuilding with groovy 3.0.25.
Still get lots of javax.el.PropertyNotFoundException, which makes me
nervous.
RE: Re: invoice printing problem
Posted by Carsten Heinrigs <ca...@cahein.de>.
Hi Aditi,
thanks for responding so quickly.
1) Unfortunately, party_pref_doc_type_tpl is empty.
2) Upgraded from 24.09.05 to 24.09.07
Note: we get plenty of javax.el.PropertyNotFoundException.
On 2026/09/01 08:40:48 Aditi Patel wrote:
1)
> The cause is almost certainly a "Doc. Type template" entry in your
> accounting configuration: a PartyPrefDocTypeTpl row for an invoice
> type with no custom screen attached.
2)
> One question, if you do not mind: which version did you upgrade from?
Best regards,
Carsten
Re: invoice printing problem
Posted by Aditi Patel <ad...@hotwax.co>.
Hi Carsten,
Thanks for the detailed log; it was enough to reproduce this on a clean
24.09.07 with demo data, and I get your exact lines back, down to FOP's
"Document is empty".
The cause is almost certainly a "Doc. Type template" entry in your
accounting configuration: a PartyPrefDocTypeTpl row for an invoice type
with no custom screen attached.
InvoicePDF does not name its template directly. DocTypeTemplate.groovy
looks one up, and only falls back to DefaultInvoicePDF when *no* row is
found. If a row is found but its screen is empty, null gets assigned - and
OFBiz's EL cannot tell a null value from a missing one, so it reports
"Cannot resolve identifier 'templateName'". include-screen then skips
silently, the FO document comes out empty, and FOP is the first component
to actually complain.
What makes this easy to hit by accident: under Accounting -> your
organisation -> "Doc. Type template", the screen drop-down's first option
is labelled "Default Screen" and carries an empty value. Choosing it saves
a row with no screen, which is exactly what blanks the PDF.
To check:
SELECT p.PARTY_PREF_DOC_TYPE_TPL_ID, p.PARTY_ID, p.INVOICE_TYPE_ID,
p.FROM_DATE, p.THRU_DATE, c.CUSTOM_SCREEN_NAME
FROM PARTY_PREF_DOC_TYPE_TPL p
LEFT JOIN CUSTOM_SCREEN c ON c.CUSTOM_SCREEN_ID = p.CUSTOM_SCREEN_ID
WHERE p.INVOICE_TYPE_ID IS NOT NULL;
Any row whose INVOICE_TYPE_ID is your invoice's type or a parent of it
(usually SALES_INVOICE -> INVOICE) and whose CUSTOM_SCREEN_NAME is null is
the one. Deleting it, or pointing it at a real CustomScreen, should restore
printing straight away.
Worth knowing while you look: the lookup filters on the document type only
- no partyId, no date filter - so a row belonging to another organisation,
or one long expired, still counts. I confirmed that with a row expired in
2021. Orders and quotes go through the same script, so they may be worth a
glance too.
If that turns out to be it, I would be glad to raise a Jira and propose a
small fix, so that an incomplete configuration falls back to the default
template instead of producing an empty document. I would credit you as
reporter, of course.
One question, if you do not mind: which version did you upgrade from? This
per-party template mechanism landed in May 2022 (OFBIZ-10215), after the
22.01 branch, so if you came from 22.01 or earlier it is new to you rather
than a regression inside the 24.09 line - that would change where I look
next.
Best regards,
Aditi
On Mon, Aug 31, 2026 08:15 PM, Carsten Heinrigs <ca...@cahein.de> wrote:
> Hello Everyone,
>
> we used to be able to print Invoices, but after an upgrade to 24.09.07
> we get an error trying to generate a PDF. The variables 'templateName'
> and 'templateLocation' cannot be resoved:
>
> applications/accounting/widget/AccountingPrintScreens.xml
>
> 2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |ModelScreenWidget
> |D| Rendering screen InvoicePDF; widget class is
> org.apache.ofbiz.widget.model.ModelScreenWidget$IncludeScreen
> 2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
> |D| Error evaluating expression ${templateName}:
> javax.el.PropertyNotFoundException: Cannot resolve identifier
> 'templateName'
> 2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
> |D| Error evaluating expression ${templateName}:
> javax.el.PropertyNotFoundException: Cannot resolve identifier
> 'templateName'
> 2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |FlexibleStringExpander
> |D| Error evaluating expression ${templateLocation}:
> javax.el.PropertyNotFoundException: Cannot resolve identifier
> 'templateLocation'
> 2026-08-31 16:34:40,070 |jsse-nio-8443-exec-3 |ModelScreenWidget
> |D| In the include-screen tag the screen name was empty, ignoring
> include; in screen [InvoicePDF]
> 2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |TransactionUtil
> |D| Current status : Transaction Active (0)
> 2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |TransactionUtil
> |D| Transaction committed
> 2026-08-31 16:34:40,071 |jsse-nio-8443-exec-3 |ScreenFopViewHandler
> |D| XSL:FO Screen Output: <?xml version="1.0" encoding="UTF-8"?>
>
>
> 2026-08-31 16:34:40,247 |jsse-nio-8443-exec-3 |ApacheFopWorker
> |I| FOP FontBaseURL: file:/home/cahein/projects/Pahema/ofbiz/pahema-
> ofbiz/framework/webapp/config/
> 2026-08-31 16:34:42,990 |jsse-nio-8443-exec-3 |ApacheFopWorker
> |W| TransformerFactory does not support ACCESS_EXTERNAL_* attributes:
> Unrecognized configuration feature:
> http://javax.xml.XMLConstants/property/accessExternalDTD
> 2026-08-31 16:34:43,029 |jsse-nio-8443-exec-3 |ScreenFopViewHandler
> |E| Unable to transform FO file: org.apache.fop.apps.FOPException:
> net.sf.saxon.trans.XPathException:
> org.apache.fop.fo.ValidationException: Document is empty (something
> might be wrong with your XSLT stylesheet).
> net.sf.saxon.trans.XPathException:
> org.apache.fop.fo.ValidationException: Document is empty (something
> might be wrong with your XSLT stylesheet).; Screen XSL:FO text was:
> <?xml version="1.0" encoding="UTF-8"?>
>
> Any help would be greatly appreciated.
>
> Thanks for your attention,
> Carsten
>
>
>
> --
> Carsten Heinrigs
> Software Beratung und Entwicklung
> Telefon: 042116767790
>
> Am Dobben 33
> 28203 Bremen
> Germany
>
> https://cahein.de
>
> Finanzamt Bremen, Steuernummer 60 228 10721
>
>
>