[MAGNOLIA-5055] info.magnolia.cms.util.ClasspathResourcesUtil.findResources(Filter) doesn't work properly with a URLClassLoader that provides http://.. URLs. Created: 23/May/13  Updated: 30/May/13  Resolved: 27/May/13

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.5.6
Fix Version/s: 4.5.9

Type: Bug Priority: Blocker
Reporter: Tomas Brimor Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mgnl-no-respond-trace.txt    
Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

We are running in to an issue where we get stuck until we go OOM due to some bad handling when the classloader provides URLs such as http://something/.
The issue comes from the fact that the code gets all the URLs the current classloader provides but doesn't seem to handle them properly knowing that it is a URLClassLoader that very well might provide http:// based URLs.

In our case our classloader will provide a url like http://something.something:0/. This is then passed through the info.magnolia.cms.util.ClasspathResourcesUtil.sanitizeToFile(URL) method which will strip this down to /.

The result of this is that the info.magnolia.cms.util.ClasspathResourcesUtil.collectFiles(Collection<String>, File, Filter) method will collect every file on the whole system.


Generated at Mon Feb 12 04:01:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.