Openbravo Issue Tracking System - Modules
View Issue Details
0031358ModulesReservations modulepublic2015-11-04 16:462015-11-09 14:09
ngarcia 
alostale 
immediatemajoralways
closedfixed 
5
 
 
2015-05-05
https://code.openbravo.com/erp/devel/pi/rev/d3e797b23239b892edc7b2140f69b7557632936f [^]
Production - Confirmed Stable
caristu
0031358: Resource Reservation widget is not working in 3.0PR15Q3, it blocks the application
Resource Reservation widget is not working in 3.0PR15Q3, it blocks the application
As system admin role:
   Install the Resources and Reservations Management module
As group admin role:
   Add the Resource Reservation widget to the workspace
   Check an empty error pop-up is shown and it could not be closed
   The log shows:
      ERROR org.openbravo.service.json.DefaultJsonDataService -
java.lang.NullPointerException
    at org.openbravo.service.json.DefaultJsonDataService.doPreAction(DefaultJsonDataService.java:812)
    at org.openbravo.service.json.DefaultJsonDataService.fetch(DefaultJsonDataService.java:101)
    at org.openbravo.service.json.DefaultJsonDataService.fetch(DefaultJsonDataService.java:92)
    at org.openbravo.module.resources.calendar.ResourcesCalendarDataSource.fetch(ResourcesCalendarDataSource.java:54)
...
No tags attached.
caused by feature request 0029782 closed gorkaion Openbravo ERP Hooks needed on some processes to be used by modules 
caused by defect 00313713.0PR15Q3 closed alostale Openbravo ERP API change: DefaultJsonDataService can't be instantiated with new 
related to defect 0031373 closed alostale Openbravo ERP UI frozen if calendar data request fails 
Issue History
2015-11-04 16:46ngarciaNew Issue
2015-11-04 16:46ngarciaAssigned To => Triage Finance
2015-11-04 16:46ngarciaResolution time => 1447282800
2015-11-04 16:47ngarciaIssue Monitored: networkb
2015-11-04 19:32vmromanosRegression date => 2015-03-17
2015-11-04 19:32vmromanosRegression introduced by commit => https://code.openbravo.com/erp/devel/main/rev/7c5e3781c593 [^]
2015-11-04 19:32vmromanosRegression level => Production - Confirmed Stable
2015-11-04 19:32vmromanosNote Added: 0081487
2015-11-04 19:32vmromanosAssigned ToTriage Finance => platform
2015-11-04 19:40vmromanosProjectModules => Openbravo ERP
2015-11-04 19:40vmromanosModules => JSON Datasource
2015-11-04 19:40vmromanosRegression introduced in release => 3.0PR15Q3
2015-11-04 19:40vmromanosTriggers an Emergency Pack => No
2015-11-04 19:40vmromanosCategoryReservations module => A. Platform
2015-11-05 09:08alostaleRelationship addedcaused by 0029782
2015-11-05 09:10alostaleRegression date2015-03-17 => 2015-05-05
2015-11-05 09:10alostaleRegression introduced by commithttps://code.openbravo.com/erp/devel/main/rev/7c5e3781c593 [^] => https://code.openbravo.com/erp/devel/pi/rev/d3e797b23239b892edc7b2140f69b7557632936f [^]
2015-11-05 09:27alostaleProjectOpenbravo ERP => Modules
2015-11-05 09:28alostaleRegression introduced in release3.0PR15Q3 =>
2015-11-05 09:28alostaleCategoryA. Platform => Resource and Reservation Management for Contracts
2015-11-05 09:29alostaleCategoryResource and Reservation Management for Contracts => Reservations module
2015-11-05 09:30alostaleReview Assigned To => caristu
2015-11-05 09:38alostaleNote Added: 0081492
2015-11-05 09:59hgbotCheckin
2015-11-05 09:59hgbotNote Added: 0081494
2015-11-05 09:59hgbotStatusnew => resolved
2015-11-05 09:59hgbotResolutionopen => fixed
2015-11-05 09:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/e17cce4891b84cf9f7a751a55872971c3c205e67 [^]
2015-11-05 10:03alostaleNote Added: 0081495
2015-11-05 10:06alostaleAssigned Toplatform => alostale
2015-11-05 12:08alostaleRelationship addedcaused by 0031371
2015-11-05 12:36alostaleRelationship addedrelated to 0031373
2015-11-09 14:09caristuNote Added: 0081624
2015-11-09 14:09caristuStatusresolved => closed

Notes
(0081487)
vmromanos   
2015-11-04 19:32   
At this point https://code.openbravo.com/erp/devel/main/rev/7c5e3781c593#l1.32 [^] the extraActions is null
(0081492)
alostale   
2015-11-05 09:38   
The problem is in org.openbravo.module.resources.calendar.ResourcesCalendarDataSource.getJsonDataService which is creating an anonymous class extending DefaultJsonDataService and instantiates it.

This, together with 0029782 causes NPE because it is assumed DefaultJsonDataService life cycle is managed by container so using @Inject should be safe, which is the case for all other DefaultJsonDataService instances. This assumption should be correct.

Therefore, the fix shouldn't be applied in DefaultJsonDataService but in ResourcesCalendarDataSource.
(0081494)
hgbot   
2015-11-05 09:59   
Repository: erp/pmods/org.openbravo.module.resources
Changeset: e17cce4891b84cf9f7a751a55872971c3c205e67
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 05 09:51:09 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.resources/rev/e17cce4891b84cf9f7a751a55872971c3c205e67 [^]

fixed bug 31358: NPE in Resource Reservation widget starting from 3.0PR15Q3

  DefaultJsonDataService assumes its life cycle is always managed by container,
  so it is safe to use dependency injection directly using @Inject annotations.

  The problem was ResourcesCalendarDataSource.getJsonDataService was creating an
  anonymous class extending DefaultJsonDataService and it was being directly
  instantiated. This caused injections points to be resolved as null and a NPE
  was thrown.

  The solution is to replace this code by an actual class extending DefaultJsonDataService
  managed by the container.

---
M src/org/openbravo/module/resources/calendar/ResourcesCalendarDataSource.java
A src/org/openbravo/module/resources/calendar/ResourcesCalendarDataService.java
---
(0081495)
alostale   
2015-11-05 10:03   
Published new Resource and Reservation Management version 1.0.100 [1] solving this issue.

[1] http://centralrepository.openbravo.com/openbravo/org.openbravo.forge.ui/sso/ForgeModuleVersionDetail?moduleVersionId=963DB4F060A64F208496A61B9E40B950 [^]
(0081624)
caristu   
2015-11-09 14:09   
Code review + testing OK.

Using version 1.0.100, the widget is added without errors into the Workspace.