Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036207Openbravo ERPZ. Otherspublic2017-06-08 14:282017-09-21 16:49
alostale 
markmm82 
lowminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036207: Finance: EntityPersistenceEventObserver validations has a high log level
Entity validations created extending EntityPersistenceEventObserver, when the validation fails an exception is thrown, and it is registered in the openbravo log file. These kind of exceptions are functional validations and should not be registered in the openbravo log with a high level
For example to make fail the validation implemented in org.openbravo.retail.posterminal.event.ProductEventHandler, try to create a product with type "Service" and checked "Show stock". The validation appears and the record cannot be saved. Observe the openbravo log a exception is registered.
The infrastructure does not log anything by default. The problem is some of these observers are throwing OBException, which by default log stack traces.

Candidates to check:

$ find -name *.java | xargs grep "extends.*EntityPersistenceEventObserver" -l | xargs grep OBException -l | sort


== Functional ==
./modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java
./modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/AcctSchemaEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/LocationSettingsHandler.java
./src/org/openbravo/event/ConversionRateEventHandler.java
./src/org/openbravo/event/DocTypeEventHandler.java
./src/org/openbravo/event/GLJournalLineEventHandler.java
./src/org/openbravo/event/InvoiceTaxEventHandler.java
./src/org/openbravo/event/MInOutLineEventHandler.java
./src/org/openbravo/event/OrderDiscountEventHandler.java
./src/org/openbravo/event/PeriodEventHandler.java
./src/org/openbravo/event/ProductAumEventHandler.java
./src/org/openbravo/event/ProductCharacteristicEventHandler.java
./src/org/openbravo/event/ProductEventHandler.java
./src/org/openbravo/event/ProductionLineEventHandler.java
./src/org/openbravo/event/ServiceOrderLineEventHandler.java
./src/org/openbravo/event/ServicePriceRuleRangeEventHandler.java
./src/org/openbravo/event/SimpleGLJournalEventHandler.java
./src/org/openbravo/event/UOMConversionEventHandler.java


== Platform ==
./modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentConfigEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachmentMetadataEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/FieldHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/NoteEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RoleAccessUniqueHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TableEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TableTreeEventHandler.java
./modules/org.openbravo.client.application/src/org/openbravo/client/application/event/WindowPersonalizationEventHandler.java
./src/org/openbravo/event/ADTableEventHandler.java
./src/org/openbravo/event/ProcessRequestEventHandler.java

== Retail ==
./modules/org.openbravo.mobile.core/src/org/openbravo/mobile/core/servercontroller/MultiServerPreferenceEventHandler.java
./modules/org.openbravo.mobile.core/src/org/openbravo/mobile/core/servercontroller/ServerStateBackgroundEventHandler.java
./modules/org.openbravo.retail.discounts/src/org/openbravo/retail/discounts/event/MOfferEventHandler.java
./modules/org.openbravo.retail.discounts/src/org/openbravo/retail/discounts/event/MOfferProductEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/ADOrgWarehouseEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/AppPaymentEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/PaymentMethodEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/PaymentMethodTypeEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/ProductEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/event/TerminalTypePaymentMethodEventHandler.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/importprocess/POSImportEntryProcessor.java
./modules/org.openbravo.retail.posterminal/src/org/openbravo/retail/posterminal/PaymentMethodHandler.java
No tags attached.
related to defect 0036183 closed platform Platform: EntityPersistenceEventObserver validations has a high log level 
related to design defect 0036527 closed alostale OBException should not log itself by default 
blocks design defect 0036162 acknowledged Triage Platform Base clean up openbravo.log 
Issue History
2017-06-08 14:28alostaleNew Issue
2017-06-08 14:28alostaleAssigned To => Triage Finance
2017-06-08 14:28alostaleModules => Core
2017-06-08 14:28alostaleTriggers an Emergency Pack => No
2017-06-08 14:28alostaleIssue generated from0036183
2017-06-08 14:28alostaleRelationship addedrelated to 0036183
2017-06-08 14:33alostaleRelationship addedblocks 0036162
2017-06-08 14:35alostaleProposed Solution updated
2017-07-24 12:06alostaleRelationship addedrelated to 0036527
2017-07-24 12:08alostaleNote Added: 0098197
2017-08-07 18:05markmm82Assigned ToTriage Finance => markmm82
2017-08-07 18:05markmm82Statusnew => scheduled
2017-08-23 11:33hgbotCheckin
2017-08-23 11:33hgbotNote Added: 0098606
2017-08-23 11:33hgbotStatusscheduled => resolved
2017-08-23 11:33hgbotResolutionopen => fixed
2017-08-23 11:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f9cb3834e16557fb3e2c2bd62b3aac86b1f39808 [^]
2017-08-23 11:34aferrazReview Assigned To => aferraz
2017-08-23 11:34aferrazNote Added: 0098607
2017-08-23 11:34aferrazStatusresolved => closed
2017-08-23 11:34aferrazFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099320

Notes
(0098197)
alostale   
2017-07-24 12:08   
After changing default behavior for OBException (0036527), review none of them should be actually logged.
(0098606)
hgbot   
2017-08-23 11:33   
Repository: erp/devel/pi
Changeset: f9cb3834e16557fb3e2c2bd62b3aac86b1f39808
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Aug 21 15:43:39 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/f9cb3834e16557fb3e2c2bd62b3aac86b1f39808 [^]

Fixes issue 36207: EntityPersistenceEventObserver validations has high log

Entity validations created extending EntityPersistenceEventObserver, when the
validation fails an exception is thrown, and it is registered in the openbravo
log file. These kind of exceptions are functional validations and should not be
registered in the openbravo log with a high level.

The problem is some of observers are throwing OBException, which by default log
stack traces.

Since 3.0PR17Q4 OBExceptions doesn't logs exceptions with stack trace by default
when a new OBException is thrown, this fix specify the second parameter of
OBException constructor as true to just logs not functional validations.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java
M src/org/openbravo/event/ServiceOrderLineEventHandler.java
---
(0098607)
aferraz   
2017-08-23 11:34   
Code review OK
(0099320)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test