Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025016Openbravo ERPA. Platformpublic2013-10-25 00:182014-08-26 17:14
shuehner 
inigosanchez 
normalminorhave not tried
closedfixed 
5
 
3.0PR14Q4 
AugustoMauch
Core
No
0025016: NPE when calling Process via toolbar button and the process is not putting a message into its ProcessBundle
When you have a class implementing a process and calling that Process from a toolbar button.

And the class does not put an instance of OBError into the message of its processbundle to show result

Then the WAD-generated servlet code fails with a NPE.

Additionally the try/catch present in that wad-code is missing to print a stacktrace making if very hard to diagnose the error.
- See description.
1.) Fix wad-generated code of button to have 2 changes
1.a) Do not fail if pb.getResult() is null.
1.b) Change log4j.errror of that catch to be 'log4j.error("Error calling process", ex)' so its logs a stacktrace.

Relevant code in the wad-generatd servlet is:


        OBError myMessage = null;
        try {
          new ProcessRunner(pb).execute(this);
          myMessage = (OBError) pb.getResult();
          myMessage.setMessage(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getMessage()));
          myMessage.setTitle(Utility.parseTranslation(this, vars, vars.getLanguage(), myMessage.getTitle()));
        } catch (Exception ex) {
          myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
          log4j.error(ex);
No tags attached.
Issue History
2013-10-25 00:18shuehnerNew Issue
2013-10-25 00:18shuehnerAssigned To => AugustoMauch
2013-10-25 00:18shuehnerModules => Core
2013-10-25 00:18shuehnerTriggers an Emergency Pack => No
2014-06-30 12:47alostaleAssigned ToAugustoMauch => inigosanchez
2014-08-26 00:38hgbotCheckin
2014-08-26 00:38hgbotNote Added: 0069725
2014-08-26 00:38hgbotStatusnew => resolved
2014-08-26 00:38hgbotResolutionopen => fixed
2014-08-26 00:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/edc2a785a7a3abc57c88698e2331d24fc5fa749d [^]
2014-08-26 09:42AugustoMauchReview Assigned To => AugustoMauch
2014-08-26 09:42AugustoMauchNote Added: 0069745
2014-08-26 09:42AugustoMauchStatusresolved => closed
2014-08-26 09:42AugustoMauchFixed in Version => 3.0PR14Q4
2014-08-26 17:14hudsonbotCheckin
2014-08-26 17:14hudsonbotNote Added: 0069766

Notes
(0069725)
hgbot   
2014-08-26 00:38   
Repository: erp/devel/pi
Changeset: edc2a785a7a3abc57c88698e2331d24fc5fa749d
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Tue Aug 26 00:36:56 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/edc2a785a7a3abc57c88698e2331d24fc5fa749d [^]

Fixes issue 25016: NPE when calling process via toolbar button.

This issue fix 2 things:
1a) Do not fail if ph.getResult() is null.
2a) Change message in log4j.error.

---
M src-wad/src/org/openbravo/wad/ActionButtonJava_Responser.javaxml
---
(0069745)
AugustoMauch   
2014-08-26 09:42   
Code reviewed and verified in pi@edc2a785a7a3
(0069766)
hudsonbot   
2014-08-26 17:14   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/52ea34dbb55d [^]
Maturity status: Test