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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0022650
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorsometimes2012-12-21 08:162013-02-20 04:49
ReportermalsasuaView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0MP21
StatusclosedFix in branchFixed in SCM revision1f39c81dc9b9
ProjectionnoneETAnoneTarget Version3.0MP21
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_18
OS VersionCommunity ApplianceDatabase version8.3.9Ant version1.7.1
Product VersionSCM revision 
Review Assigned Toshankarb
Web browserGoogle Chrome
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2012-10-29
Regression introduced in release
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/8d14f5d88c458fd555bdfc4202205bc58b2bd8e0 [^]
Triggers an Emergency PackNo
Summary

0022650: error in the log file is displayed when login is done without "User-Agent"

Descriptionwhen a login is done from request without "User-Agent", an error is displayed in the log file
Steps To ReproduceThe error is:

ef0fb8d 11:26:48 [ajp-8009-39] ERROR org.openbravo.dal.core.ThreadHandler -
java.lang.NullPointerException
        at org.openbravo.erpCommon.utility.Utility.isMobileBrowser(Utility.java:2500)
        at org.openbravo.erpCommon.security.Login.doPost(Login.java:55)
        at org.openbravo.base.HttpBaseServlet.doGet(HttpBaseServlet.java:287)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at org.openbravo.base.HttpBaseServlet.service(HttpBaseServlet.java:245)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
....
Proposed SolutionIn Utility.java, replace the method
public static boolean isMobileBrowser(HttpServletRequest request) {
    final String ua = request.getHeader("User-Agent").toLowerCase();
    return (ua.matches(MOBILE_VENDORS) || ua.substring(0, 4).matches(MOBILE_VERSION));
  }

by
public static boolean isMobileBrowser(HttpServletRequest request) {
    final String ua = request.getHeader("User-Agent");
    if (ua == null) then return null;
    return (ua.toLowerCase().matches(MOBILE_VENDORS) || ua.toLowerCase().substring(0, 4).matches(MOBILE_VERSION));
  }
TagsNo tags attached.
Attached Filesdiff file icon issue22650.diff [^] (646 bytes) 2013-02-05 16:57 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0056175)
AugustoMauch (manager)
2013-02-05 16:58

A patch for this issue has been attached. It will be pushed to pi once it is unfrozen for MP21 issues.
(0056344)
hgbot (developer)
2013-02-11 17:37

Repository: erp/devel/pi
Changeset: 1f39c81dc9b9090197eac10ae23a413fc07504b5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Feb 11 17:35:08 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1f39c81dc9b9090197eac10ae23a413fc07504b5 [^]

Fixes issue 22650: NPE not thrown if login is done without 'User-Agent'

The isMobileBrowser of the Utility class was not taking into account that the 'User-Agent' property of the requeste could be null.

---
M src/org/openbravo/erpCommon/utility/Utility.java
---
(0056370)
shankarb (reporter)
2013-02-12 12:20

Code reviewed and verified in pi changeset 5265a23b7dbe
(0056567)
hudsonbot (developer)
2013-02-20 04: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/d828167a9e83 [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2012-12-21 08:16 malsasua New Issue
2012-12-21 08:16 malsasua Assigned To => AugustoMauch
2012-12-21 08:16 malsasua Web browser => Google Chrome
2012-12-21 08:16 malsasua Modules => Core
2012-12-21 08:16 malsasua Triggers an Emergency Pack => No
2013-01-22 15:47 AugustoMauch Web browser Google Chrome => Google Chrome
2013-01-22 15:47 AugustoMauch Fixed in Version => 3.0MP20
2013-01-22 15:52 AugustoMauch Web browser Google Chrome => Google Chrome
2013-01-22 15:52 AugustoMauch Regression level => Production - Confirmed Stable
2013-01-22 15:52 AugustoMauch Regression date => 2012-10-29
2013-01-22 15:52 AugustoMauch Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/8d14f5d88c458fd555bdfc4202205bc58b2bd8e0 [^]
2013-02-05 16:57 AugustoMauch Web browser Google Chrome => Google Chrome
2013-02-05 16:57 AugustoMauch Fixed in Version 3.0MP20 =>
2013-02-05 16:57 AugustoMauch Target Version => 3.0MP21
2013-02-05 16:57 AugustoMauch File Added: issue22650.diff
2013-02-05 16:58 AugustoMauch Note Added: 0056175
2013-02-05 16:59 AugustoMauch Status new => scheduled
2013-02-05 16:59 AugustoMauch fix_in_branch => pi
2013-02-11 17:35 AugustoMauch Issue Monitored: shankarb
2013-02-11 17:35 AugustoMauch Review Assigned To => shankarb
2013-02-11 17:35 AugustoMauch Web browser Google Chrome => Google Chrome
2013-02-11 17:35 AugustoMauch fix_in_branch pi =>
2013-02-11 17:37 hgbot Checkin
2013-02-11 17:37 hgbot Note Added: 0056344
2013-02-11 17:37 hgbot Status scheduled => resolved
2013-02-11 17:37 hgbot Resolution open => fixed
2013-02-11 17:37 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f39c81dc9b9090197eac10ae23a413fc07504b5 [^]
2013-02-12 12:20 shankarb Note Added: 0056370
2013-02-12 12:20 shankarb Status resolved => closed
2013-02-12 12:20 shankarb Fixed in Version => 3.0MP21
2013-02-20 04:49 hudsonbot Checkin
2013-02-20 04:49 hudsonbot Note Added: 0056567


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker