Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047546Openbravo ERPE. Translationpublic2021-08-13 09:442021-08-13 12:11
Pre packaging ( pi )
pi [^]
0047546: Install a translation module from the command line fails
After the changes introduced with 0047259 the installation of translation modules fails from the command line. This is because in that case WeldUtils is not properly initialized because we are outside of a servlet context.
1) Clone a translation module into the modules folder. Ex: [^]
2) Run ant smartbuild -Dlocal=no

The translation import process fails with the following error:

     [java] 2334 [main] ERROR org.openbravo.erpCommon.ad_forms.TranslationManager - importTrlFile - error parsing file: /home/openbravo/src/issues/openbravo/modules/org.openbravo.retail.posterminal.es_ES/referencedata/translation/es_ES//AD_ELEMENT_TRL_es_ES.xml
     [java] java.lang.NullPointerException: null
     [java] at org.openbravo.base.weld.WeldUtils.getStaticInstanceBeanManager( ~[classes/:?]
     [java] at org.openbravo.base.weld.WeldUtils.getInstances( ~[classes/:?]
No tags attached.
caused by defect 0047259 closed caristu Translation done with the 'Translator Helper' are now shown in the POS doing a 'Refresh data' or even Full Refresh 
Issue History
2021-08-13 09:44caristuNew Issue
2021-08-13 09:44caristuAssigned To => caristu
2021-08-13 09:44caristuModules => Core
2021-08-13 09:44caristuTriggers an Emergency Pack => No
2021-08-13 09:44caristuIssue generated from0047259
2021-08-13 09:44caristuRelationship addedcaused by 0047259
2021-08-13 09:45caristuRegression level => Pre packaging ( pi )
2021-08-13 09:45caristuRegression introduced in release => pi
2021-08-13 09:45caristuRegression introduced by commit => [^]
2021-08-13 09:56hgbotNote Added: 0131110
2021-08-13 11:18caristuSummaryInstall a translation module from the console fails => Install a translation module from the command line fails
2021-08-13 11:18caristuDescription Updatedbug_revision_view_page.php?rev_id=22996#r22996
2021-08-13 12:09vmromanosNote Added: 0131112
2021-08-13 12:11hgbotResolutionopen => fixed
2021-08-13 12:11hgbotStatusnew => closed
2021-08-13 12:11hgbotNote Added: 0131113
2021-08-13 12:11hgbotFixed in Version => PR21Q4
2021-08-13 12:11hgbotNote Added: 0131114

2021-08-13 09:56   
Merge Request created: [^]
2021-08-13 12:09   
Tested and worked fine:
- Install source
- Translator Helper import properly updates POS labels after a refresh
2021-08-13 12:11   
Merge request merged: [^]
2021-08-13 12:11   
Directly closing issue as related merge request is already approved.

Repository: [^]
Changeset: cd23e2e3c994ee1d28f3566c3b1154f75189e338
Author: Carlos Aristu <>
Date: 2021-08-13T11:18:51+02:00
URL: [^]

fixes ISSUE-47546: Install translations from command line fails

  The TranslationManagerHook instances are retrieved with WeldUtils
which can not be properly initialized outside of a servlet context, for
example when installing translations directly from the command line. In
that case a NPE was being thrown.

  Now we ensure that we are in a servlet context before trying to get
the TranslationManagerHook instances with WeldUtils.

M src/org/openbravo/erpCommon/ad_forms/