Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020788Openbravo ERPA. Platformpublic2012-06-16 15:592012-06-29 12:43
shuehner 
alostale 
normalmajorhave not tried
closedfixed 
5
3.0MP7.1 
3.0MP13 
Core
No
0020788: Calls to dal-based webservices fail if the license contains an expired module and the auth is done in the ws-call
When doing a call to i.e. /ws/dal without having an active session, but passing user+password parameters in the request itself

and

having that instance activated with a license which contains at least one module which is expired (it does not matter if that module is really installed or not).

Then the ws-call fails with the following error:
org.openbravo.base.exception.OBException: Exception thrown Exception thrown null
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:63)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)

root cause

org.openbravo.base.exception.OBException: Exception thrown null
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:63)
    org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)

root cause

java.lang.NullPointerException
    org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:569)
    org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:560)
    org.openbravo.dal.service.OBDal.get(OBDal.java:274)
    org.openbravo.erpCommon.obps.ActivationKey.getExpiredInstalledModules(ActivationKey.java:1159)
    org.openbravo.erpCommon.obps.ActivationKey.checkOPSLimitations(ActivationKey.java:864)
    org.openbravo.erpCommon.obps.ActivationKey.refreshIfNeeded(ActivationKey.java:1303)
    org.openbravo.erpCommon.obps.ActivationKey.getInstance(ActivationKey.java:247)
    org.openbravo.authentication.AuthenticationManager.webServicePostAuthenticate(AuthenticationManager.java:213)
    org.openbravo.authentication.AuthenticationManager.webServiceAuthenticate(AuthenticationManager.java:181)
    org.openbravo.service.web.BaseWebServiceServlet.service(BaseWebServiceServlet.java:69)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:41)
    org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
Activate an instance with a license having at least one module in the license which is expired (to-date < today)
Make sure no active login from the current browser exists
Do a call to the following url:
http://localhost:8080/openbravo/ws/dal?l=Openbravo&p=openbravo [^]

Notice it fails
No tags attached.
diff issue_20788_mp7.1.diff (1,682) 2012-06-16 16:02
https://issues.openbravo.com/file_download.php?file_id=5302&type=bug
Issue History
2012-06-16 15:59shuehnerNew Issue
2012-06-16 15:59shuehnerAssigned To => alostale
2012-06-16 15:59shuehnerModules => Core
2012-06-16 16:00shuehnerNote Added: 0049874
2012-06-16 16:01shuehnerNote Added: 0049875
2012-06-16 16:02shuehnerFile Added: issue_20788_mp7.1.diff
2012-06-16 16:02shuehnerNote Added: 0049876
2012-06-18 12:09alostaleNote Added: 0049888
2012-06-19 11:38alostaleNote Added: 0049912
2012-06-19 11:43hgbotCheckin
2012-06-19 11:43hgbotNote Added: 0049913
2012-06-19 11:43hgbotStatusnew => resolved
2012-06-19 11:43hgbotResolutionopen => fixed
2012-06-19 11:43hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/61be8cba1e0458d4ec90840af1d96fb0cb6dbdb7 [^]
2012-06-27 05:28hudsonbotCheckin
2012-06-27 05:28hudsonbotNote Added: 0050122
2012-06-29 12:43AugustoMauchNote Added: 0050282
2012-06-29 12:43AugustoMauchStatusresolved => closed
2012-06-29 12:43AugustoMauchFixed in Version => 3.0MP13

Notes
(0049874)
shuehner   
2012-06-16 16:00   
That issue is reproducible in both 3.0MP7.1 and also in latest pi (rev: 577ab9166797 from 2012-06-16).
(0049875)
shuehner   
2012-06-16 16:01   
There is a testing license created in butler which can be used to reproduce the bug (search for the issue in in the customer name field in all licenses)
(0049876)
shuehner   
2012-06-16 16:02   
The attached patch against mp7.1 seems to be fix issue so could be used as a base for a fix.
(0049888)
alostale   
2012-06-18 12:09   
Note this issue occurs when there is at least an expired module in the license, regardless it is actually installed in the instance or not.
(0049912)
alostale   
2012-06-19 11:38   
Provided fix affects license validation for ws, defined test plan should cover possible cases, so the fix shouldn't be regression risky.

Executed test plan:

*Apply license with a module having expiration date before than license expiration date
*Before the module date expires, install it
*Test dal ws works properly
*Set date to after expiration
*Test dal ws doesn't work with a proper message
*Disable the module
*Test dal ws works properly
*Uninstall the module
*Test dal ws works properly
(0049913)
hgbot   
2012-06-19 11:43   
Repository: erp/devel/pi
Changeset: 61be8cba1e0458d4ec90840af1d96fb0cb6dbdb7
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jun 19 11:42:38 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/61be8cba1e0458d4ec90840af1d96fb0cb6dbdb7 [^]

fixed bug 20788: Call to dal ws fail if the license contains an expired module

---
M src/org/openbravo/authentication/AuthenticationManager.java
M src/org/openbravo/base/secureApp/LoginHandler.java
M src/org/openbravo/erpCommon/obps/ActivationKey.java
---
(0050122)
hudsonbot   
2012-06-27 05:28   
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/cf3a7135839f [^]

Maturity status: Test
(0050282)
AugustoMauch   
2012-06-29 12:43   
Code reviewed and verified in pi@419121245486