Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0022235 | Openbravo ERP | A. Platform | public | 2012-11-08 11:19 | 2013-01-03 13:12 |
|
Reporter | caristu | |
Assigned To | mtaal | |
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | 3.0MP19 | Fixed in Version | 3.0MP19 | |
Merge Request Status | |
Review Assigned To | AugustoMauch |
OBNetwork customer | OBPS |
Web browser | |
Modules | Core |
Support ticket | 17822 |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0022235: OBMessageUtils asumes incorrectly that RequestContext is set |
Description | If you extend a class from DalProcess and you call call RequestContext.get().getVariablesSecureApp(); it returns null.
So for example, if you use any of the public methods of OBMessageUtils() that uses the previous statement, the process crashes because we are obtaining a null reference. For example, the translateError() method is using this practise:
public static OBError translateError(String message) {
VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
final String strLanguage = OBContext.getOBContext().getLanguage().getLanguage();
return translateError(new DalConnectionProvider(false), vars, strLanguage, message);
}
So, we can't use this approach, instead we must use the ProcessBudle class to obtain the vars variable: bundle.getContext().toVars(); |
Steps To Reproduce | - Create a new process extending DalBaseProcess class
- Try to use any of the methods of OBMessageUtils() that uses RequestContext(), for example the translateError() method |
Proposed Solution | The current implementation of OBMessageUtils incorrectly uses the RequestContext, assuming that it is always set. Proposed Solutions:
- deprecate this OBMessageUtils method or remove it (api change)
- add an abstraction for RequestContext that only provides the things common to process threads and http request threads (like VariablesSecureApp) and then use this ThreadContext object in all the places in core where RequestContext is being used. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0024832 | 3.0MP29 | closed | shankarb | EntityPersistenceEventObserver: cascade errors from ProcessBundle are not displayed |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2012-11-08 11:19 | caristu | New Issue | |
2012-11-08 11:19 | caristu | Assigned To | => AugustoMauch |
2012-11-08 11:19 | caristu | Modules | => Core |
2012-11-08 11:19 | caristu | OBNetwork customer | => Yes |
2012-11-08 11:19 | caristu | Support ticket | => 17822 |
2012-11-08 11:19 | caristu | Resolution time | => 1355094000 |
2012-11-19 17:09 | AugustoMauch | Assigned To | AugustoMauch => shankarb |
2012-11-21 11:31 | shankarb | Assigned To | shankarb => AugustoMauch |
2012-12-04 12:39 | AugustoMauch | Target Version | 3.0MP18 => 3.0MP19 |
2012-12-10 14:28 | mtaal | Assigned To | AugustoMauch => mtaal |
2012-12-27 08:23 | mtaal | Review Assigned To | => AugustoMauch |
2012-12-27 08:23 | mtaal | Triggers an Emergency Pack | => No |
2012-12-27 08:23 | mtaal | Note Added: 0055229 | |
2012-12-27 08:26 | hgbot | Checkin | |
2012-12-27 08:26 | hgbot | Note Added: 0055230 | |
2012-12-27 08:26 | hgbot | Status | new => resolved |
2012-12-27 08:26 | hgbot | Resolution | open => fixed |
2012-12-27 08:26 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/f2eb38f962af844d217dd50974a355521094841c [^] |
2012-12-27 08:27 | hgbot | Checkin | |
2012-12-27 08:27 | hgbot | Note Added: 0055231 | |
2013-01-02 11:05 | AugustoMauch | Note Added: 0055303 | |
2013-01-02 11:05 | AugustoMauch | Status | resolved => closed |
2013-01-02 11:05 | AugustoMauch | Fixed in Version | => 3.0MP19 |
2013-01-03 13:12 | hudsonbot | Checkin | |
2013-01-03 13:12 | hudsonbot | Note Added: 0055325 | |
2013-01-03 13:12 | hudsonbot | Checkin | |
2013-01-03 13:12 | hudsonbot | Note Added: 0055326 | |
2013-09-25 17:51 | vmromanos | Relationship added | related to 0024832 |