[MAGNOLIA-6581] Classpath service won't serve resource if virtual tree has a file/folder overlap Created: 04/Mar/16 Updated: 15/Mar/21 Resolved: 15/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | resource-loader |
| Affects Version/s: | 5.4.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Mikaël Geljić | Assignee: | Mikaël Geljić |
| Resolution: | Outdated | Votes: | 0 |
| Labels: | classpath, resources | ||
| Remaining Estimate: | 4d | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | 4d | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| 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
|
||||||||||||||||||||||||||||||||
| Story Points: | 8 | ||||||||||||||||||||||||||||||||
| Description |
|
Classpath service/origin should serve resource files no matter what; and regardless of how we model that as a virtual directory structure. Assuming you have:
http://localhost:8080/magnoliaAuthor/.resources/test/samename is served properly This is clearly highlighted in ClasspathEntryResolver, that it ignores sub-directory structures in such cases—which to me is just wrong.
Other potential harmful (and deferred) side-effect: create a "travel-demo" mgnl:content node in resources workspace, on next restart the whole travel-demo is down. |
| Comments |
| Comment by Mikaël Geljić [ 04/Mar/16 ] |
|
mind that with my patch (branch classpath-entry-resolver on my fork), duplicates result in the following log, while individual files get served anyway indeed:
2016-03-04 13:34:30,363 WARN nolia.resourceloader.layered.LayeredResourceOrigin: Resources at /travel-demo are not all directory/file: [JcrResource{origin=jcr,path=/travel-demo,file}, ClasspathResource{origin=classpath,path=/travel-demo,(directory)}]
That log shows up e.g. in the Resource Files app, not while browsing site by any means. |
| Comment by Mikaël Geljić [ 07/Mar/16 ] |
|
Linking to module A:
module B
There is still one of the two conflicting files which cannot be served (results in 400 btw, not 404). |
| Comment by Mikaël Geljić [ 07/Mar/16 ] |
|
Attaching couple minimal jars reflecting situation above (within one "overlap" root directory) |