[MAGNOLIA-2270] Better logs and avoid NPEs when magnolia is started from an unexpanded war Created: 16/Jul/08 Updated: 23/Jan/13 Resolved: 17/Jul/08 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 3.6 RC1 |
| Fix Version/s: | 3.6 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Fabrizio Giustina | Assignee: | Fabrizio Giustina |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| 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 |
|
Magnolia doesn't work with if started from an unexpanded war, as we know, but we also should give a better output. |
| Comments |
| Comment by Fabrizio Giustina [ 16/Jul/08 ] |
|
fixed in r16847, will merge on branch |
| Comment by Magnolia International [ 16/Jul/08 ] |
|
svn propedit --revprop svn:log -r <revision-number> please |
| Comment by Fabrizio Giustina [ 16/Jul/08 ] |
|
you can see the diff from the branch, I committed it using the jira number. Please don't be too picky with this kind of changes, it could become really annoying... |
| Comment by Jan Haderka [ 16/Jul/08 ] |
|
Fabrizio, |
| Comment by Fabrizio Giustina [ 16/Jul/08 ] |
|
> I would prefer not to make changes to this kind of very central classes while being in RC. the only change is the exception message, there is nothing else changed here... we just tried to run it on tomcat6 from an unexpanded war and we saw that it crashes since context.getRealPath(StringUtils.EMPTY) returns a null, nothing more. |
| Comment by Magnolia International [ 16/Jul/08 ] |
|
Changing the exception message (and mostly avoiding the npe when generating it) is a good thing, but i'd like to get rid of the false statement that was introduced in it. thanks. |
| Comment by Fabrizio Giustina [ 16/Jul/08 ] |
|
mh, I am not so sure it's a false statement, at least not for any appserver: servletContext.getRealPath() can return null for unexpanded wars and magnolia crashes at startup for that... |
| Comment by Jan Haderka [ 17/Jul/08 ] |
|
The only app server I've seen so far returning null was Weblogic 9 and older. And for this we have a solution in form of special module that takes care of the things (since there was more customization necessary then just this listener). |
| Comment by Fabrizio Giustina [ 17/Jul/08 ] |
|
> it is not correct to give false impression that you can't run as a war file in general. the check here is clean and simple:
|
| Comment by Jan Haderka [ 17/Jul/08 ] |
My take on this is as follows:
So the statement in the error message Magnolia needs to be run from an expanded webapp is not correct. The correct message in this case would be "Real path can't be obtained. Magnolia is not configured properly and therefore unable to start. Please refer to Magnolia documentation for installation instructions specific for your environment (OS, app server)." |
| Comment by Magnolia International [ 17/Jul/08 ] |
|
corrected error message on trunk and 3.6-rc branch |