[MAGNOLIA-5816] Magnolia doesn't start on IBM Liberty Profile Created: 19/Jun/14 Updated: 08/Aug/14 Resolved: 23/Jul/14 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 5.2, 5.3, 5.3.1 |
| Fix Version/s: | 5.3.2 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Daniel Lipp | Assignee: | Daniel Lipp |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | quickwin | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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)
|
| Date of First Response: |
| Description |
|
IBM's Liberty Profile as both - a standalone product and the base for Websphere Application Server. IBM uses it as it's default runtime when hosting Apps in their BlueMix Cloud Platform (based on Cloud Foundry). Unfortunately Magnolia will always throw a RuntimeException ("Magnolia is not configured properly and therefore unable to start: real path can't be obtained...") when starting up the system on Liberty. Caution: make sure to deploy as exploded war - else ServletContext#getRealPath(String) will always return <null> (see the spec) |
| Comments |
| Comment by Daniel Lipp [ 19/Jun/14 ] | ||||||||||||
|
It turned out that DefaultMagnoliaInitPaths#determineRootPath from ServletContext.getRealPath(StringUtils.EMPTY) always returns null on IBM Liberty (even when deployed as exploded war) where as
ServletCntext.getRealPath("/")
works as expected. Obviously most other servers (Tomcat, Jetty, ...) support getRealPath(StringUtils.EMPTY). | ||||||||||||
| Comment by Daniel Lipp [ 19/Jun/14 ] | ||||||||||||
|
Some test results with ServletContext.getRealPath(String) "" vs. "/"
In other words: calling getRealPath(String) with "/" instead of "" could do the trick for many servers but we cannot be sure it would work for all servers. The spec isn't precise enough and there's no documentation on which server behaves how. | ||||||||||||
| Comment by Daniel Lipp [ 19/Jun/14 ] | ||||||||||||