Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0024832
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2013-09-25 17:502013-10-21 10:19
ReportervmromanosView Statuspublic 
Assigned Toshankarb 
PriorityurgentResolutionfixedFixed in Version3.0MP29
StatusclosedFix in branchFixed in SCM revision18f6233c80af
ProjectionnoneETAnoneTarget Version3.0MP29
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_12
OS VersionDebian 5.0Database version8.3.8Ant version1.7.0
Product VersionpiSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0024832: EntityPersistenceEventObserver: cascade errors from ProcessBundle are not displayed

DescriptionInside an EntityPersistenceEventObserver run a Process through a ProcessBundle. If the process execution raises an exception, the EntityPersistenceEventObserver is unable to show it into the User Interface, and instead it shows the message: "Saving failed. org.openbravo.base.exception.OBException: No request object set"

The cause is in the DalBaseProcess class. At the end of the finally the RequestContext is cleared: RequestContext.clear();
This sentence avoids the EntityPersistenceEventObserver to show the ProcessBundle real exception.
Steps To ReproduceCreate an EntityPersistenceEventObserver for any entity.
Run any Process using the ProcessBundle object inside the EntityPersistenceEventObserver, ensuring the execution raises an Exception.

Simplified example:
Inside the EntityPersistenceEventObserver:
try {
      final ProcessBundle bundle = new ProcessBundle(
          SMT001_Constant.PROCESS_UPDATEINVOICEPLAN_CONTRACT_PROCESS_ID, vars)
          .init(new DalConnectionProvider(false));
      bundle.getParams().put(SMT001_Constant.PROCESS_UPDATEINVOICEPLAN_CONTRACT_C_PROJECT_ID_PARAM,
          contract.getId());
      final UpdateInvoicePlan updateInvoicePlanContractProcess = new UpdateInvoicePlan();
      updateInvoicePlanContractProcess.setDoCommit(false);
      updateInvoicePlanContractProcess.execute(bundle);
    } catch (Exception e) {
      throw new OBException(e.getMessage());
    }


Inside the Process (in the example the UpdateInvoicePlan class):
throw new OBException("@PriceListVersionNotFound@. @Product@: " + product.getIdentifier()
            + " @Date@: " + OBDateUtils.formatDate(date));
Proposed SolutionRemove the RequestContext.clear(); sentence at DalBaseProcess class
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00222353.0MP19 closedmtaal OBMessageUtils asumes incorrectly that RequestContext is set 

-  Notes
(0061599)
mtaal (manager)
2013-10-07 20:02

I think the best approach is to before the try before setting variables secure app, get the current variables secure app
and then restoring that value later at the end.

So something like:
VariablesSecureApp currentVariablesSecureApp = RequestContext.get().getVariableSecureApp();
    RequestContext.get().setVariableSecureApp(processContext.toVars());
try {
...
}
...
      OBContext.setOBContext(currentOBContext);
      RequestContext.get().setVariableSecureApp(currentVariablesSecureApp);
(0061665)
hgbot (developer)
2013-10-14 19:30

Repository: erp/devel/pi
Changeset: 18f6233c80af03af357e5bdaa7e4d40d81f3fdb1
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Mon Oct 14 22:54:21 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/18f6233c80af03af357e5bdaa7e4d40d81f3fdb1 [^]

Fixes Issue 0024832: EntityPersistenceEventObserver: cascade errors from ProcessBundle are not displayed

The RequestContext is not cleared to provide the user any errors that is being thrown by the process.

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/service/db/DalBaseProcess.java
---
(0061751)
hudsonbot (developer)
2013-10-16 19:47

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/51315988909a [^]

Maturity status: Test
(0061813)
AugustoMauch (manager)
2013-10-21 10:19

Code reviewed and verified in pi@cf31b113f28f

- Issue History
Date Modified Username Field Change
2013-09-25 17:50 vmromanos New Issue
2013-09-25 17:50 vmromanos Assigned To => AugustoMauch
2013-09-25 17:50 vmromanos Modules => Core
2013-09-25 17:50 vmromanos Triggers an Emergency Pack => No
2013-09-25 17:51 vmromanos Relationship added related to 0022235
2013-09-26 07:57 alostale Target Version 3.0MP28 => 3.0MP29
2013-10-03 09:00 shankarb Assigned To AugustoMauch => shankarb
2013-10-07 20:02 mtaal Note Added: 0061599
2013-10-14 19:29 shankarb Review Assigned To => AugustoMauch
2013-10-14 19:30 hgbot Checkin
2013-10-14 19:30 hgbot Note Added: 0061665
2013-10-14 19:30 hgbot Status new => resolved
2013-10-14 19:30 hgbot Resolution open => fixed
2013-10-14 19:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/18f6233c80af03af357e5bdaa7e4d40d81f3fdb1 [^]
2013-10-16 19:47 hudsonbot Checkin
2013-10-16 19:47 hudsonbot Note Added: 0061751
2013-10-21 10:19 AugustoMauch Note Added: 0061813
2013-10-21 10:19 AugustoMauch Status resolved => closed
2013-10-21 10:19 AugustoMauch Fixed in Version => 3.0MP29


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker