Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046579Openbravo ERPA. Platformpublic2021-05-07 11:302021-05-17 10:15
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
PR21Q2PR21Q2 
Core
No
0046579: junit DataSourceSecurity.fetchShouldBeAllowedOnlyIfRoleIsGranted fails on Tomcat9 (only for Datasource: AccountTreeMovement)
This junit test fails when application is deployed on tomcat 9.x but only for the specific datasource AccountTreeMovement.
It shows 4 failures as four RoleTypes are tested for each dataSource.

Problem is the test triggering the following error on tomcat 9.x:
May 05 12:27:36 ip-172-31-9-130 tomcat9[2709]: Error parsing HTTP request header
May 05 12:27:36 ip-172-31-9-130 tomcat9[2709]: Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
May 05 12:27:36 ip-172-31-9-130 tomcat9[2709]: java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Deploy application with tomcat 9.x
ant run.test -Dtest=org.openbravo.test.datasource.DataSourceSecurity

Check result*.xml file in src/ folder for the result of the test run
Fix the invalid request target (values in url) to be valid.

No tags attached.
depends on backport 0046580PR21Q2 closed alostale junit DataSourceSecurity.fetchShouldBeAllowedOnlyIfRoleIsGranted fails on Tomcat9 (only for Datasource: AccountTreeMovement) 
blocks defect 0046520PR21Q3 closed alostale junit DataSourceSecurity.fetchShouldBeAllowedOnlyIfRoleIsGranted fails on Tomcat9 (only for Datasource: AccountTreeMovement) 
Issue History
2021-05-07 11:30alostaleNew Issue
2021-05-07 11:30alostaleAssigned To => alostale
2021-05-07 11:30alostaleModules => Core
2021-05-07 11:30alostaleTriggers an Emergency Pack => No
2021-05-07 11:30alostaleIssue generated from0046567
2021-05-07 11:30alostaleRelationship addedblocks 0046520
2021-05-07 11:31alostaleStatusnew => scheduled
2021-05-07 11:32alostaleTarget Version => PR21Q2
2021-05-17 08:10hgbotNote Added: 0128170
2021-05-17 10:15hgbotNote Added: 0128200
2021-05-17 10:15hgbotResolutionopen => fixed
2021-05-17 10:15hgbotStatusscheduled => closed
2021-05-17 10:15hgbotFixed in Version => PR21Q2
2021-05-17 10:15hgbotNote Added: 0128201

Notes
(0128170)
hgbot   
2021-05-17 08:10   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/364 [^]
(0128200)
hgbot   
2021-05-17 10:15   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/364 [^]
(0128201)
hgbot   
2021-05-17 10:15   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 7383d37dc6b338cc677c5a59fd790363bab2d442
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-05-17T08:09:13+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/7383d37dc6b338cc677c5a59fd790363bab2d442 [^]

fixes BUG-46579: DataSourceSecurity fails on Tomcat9

fetchShouldBeAllowedOnlyIfRoleIsGranted test was creating an invalid
request by adding some parameters with special characters and not
ecoding them. Tomcat 9 is stricter parsing URLs than previous version,
not allowing this case.

Fixed by removing those parameters that were causing problems as they
were not ncessary.

---
M src-test/src/org/openbravo/test/datasource/DataSourceSecurity.java
---