Openbravo Issue Tracking System - Retail Modules
View Issue Details
0054825Retail ModulesWeb POSpublic2024-03-01 12:442024-03-01 12:52
caristu 
Retail 
highminorhave not tried
closedfixed 
5
 
RR24Q2 
No
0054825: Error shown in log when no file is defined
The fix for 0048582 does not completely fixes the problem

Define 3 POS templates without file (to use them as master data) when a login in POS is done after restart tomcat these lines of errors appears in the log

2022-02-11 17:17:04,007 [http-nio-8080-exec-7] ERROR org.openbravo.retail.posterminal.utility.OBPOSPrintTemplateReader - null cannot be read
2022-02-11 17:17:04,007 [http-nio-8080-exec-7] ERROR org.openbravo.retail.posterminal.utility.OBPOSPrintTemplateReader - null cannot be read
2022-02-11 17:17:04,008 [http-nio-8080-exec-7] ERROR org.openbravo.retail.posterminal.utility.OBPOSPrintTemplateReader - null cannot be read
Open backoffice
Login as system admin
Go to window POS print templates
Create a new template:
Module : null
Name: Test
Report: false (not checked)
Legacy: false (not checked)
Template type: Print ticket
Printing template: <output>
    <ticket>
        <line>
            <text align="center" length="42">print ticket example</text>
        </line>
    </ticket>
</output>

Reach login window in POS2 and you will see errors


With the current check template.getTemplatePath() != null || !template.getTemplatePath().isEmpty() the second condition may throw a NPE when template.getTemplatePath() is null.

Replace that condition with

a) template.getTemplatePath() != null && !template.getTemplatePath().isEmpty()
b) !StringUtils.isBlank(template.getTemplatePath())
No tags attached.
related to defect 0048582 closed sntgreale [Print templates as masterdata] error shown in log when no file is defined 
Issue History
2024-03-01 12:44caristuNew Issue
2024-03-01 12:44caristuAssigned To => Retail
2024-03-01 12:44caristuTriggers an Emergency Pack => No
2024-03-01 12:44caristuIssue generated from0048582
2024-03-01 12:44caristuRelationship addedrelated to 0048582
2024-03-01 12:46hgbotNote Added: 0161506
2024-03-01 12:52hgbotResolutionopen => fixed
2024-03-01 12:52hgbotStatusnew => closed
2024-03-01 12:52hgbotNote Added: 0161507
2024-03-01 12:52hgbotFixed in Version => RR24Q2
2024-03-01 12:52hgbotNote Added: 0161508

Notes
(0161506)
hgbot   
2024-03-01 12:46   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1496 [^]
(0161507)
hgbot   
2024-03-01 12:52   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1496 [^]
(0161508)
hgbot   
2024-03-01 12:52   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: b5f6d93691d77725994f563f8937d7a6e192c097
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 01-03-2024 12:50:02
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/b5f6d93691d77725994f563f8937d7a6e192c097 [^]

fixes BUG-54825: fix empty template path condition

---
M src/org/openbravo/retail/posterminal/utility/OBPOSPrintTemplateReader.java
---