[MAGNOLIA-2487] Empty servlet mapping causes error upon installation Created: 30/Nov/08 Updated: 13/Mar/12 Resolved: 15/Jun/10 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.3, 4.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Brian Bowman | Assignee: | Ondrej Chytil |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | installation, mapping, module, servlet | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
ubuntu 8.04 x64, tomcat 5.5, java 1.5 x64 |
||
| 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
|
| Date of First Response: |
| Description |
|
If a servlet mapping is left empty: <mappings> There is a null error upon module installation via the web interface and installation does not complete. The error message is: ERROR info.magnolia.module.ui.ModuleManagerWebUI ModuleManagerWebUI.java(run:124) 28.11.2008 14:08:11 Could not perform installation: null One fix for this is to add a null check in the execute() method of info.magnolia.module.delta.RegisterServletTask: if (pattern != null) { String mappingNodeName = Path.getUniqueLabel(mappingsNode, Path.getValidatedLabel(pattern)); final Content mappingNode = mappingsNode.createContent(mappingNodeName, ItemType.CONTENTNODE); NodeDataUtil.getOrCreateAndSet(mappingNode, "pattern", pattern); } |
| Comments |
| Comment by Magnolia International [ 01/Dec/08 ] |
|
While I agree the error handling there could be improved, what's your use case for having such an (non-) mapping? Sounds to me like it should throw some IllegalArgumentException instead of silently ignoring it. |
| Comment by Magnolia International [ 11/Dec/08 ] |
|
Brian, any opinion ? |
| Comment by Brian Bowman [ 11/Dec/08 ] |
|
Hi Gregory, I am not the developer of the servlet, so I may not be able to answer all of your questions regarding it. The servlet contains the connection information to a unique JDBC connection. It also loads some data from this connection into application scope. Some of its parameters are referenced by other classes. The exception sounds like the right solution. Thanks, |
| Comment by Magnolia International [ 11/Dec/08 ] |
|
That wouldn't happen to a loadOnStartup kind of servlet now would it? If so, it's simply not supported and will not be loaded on startup by Magnolia anyway. If you'd really need it you'd have to add it to your web.xml instead. |
| Comment by Brian Bowman [ 01/Jan/09 ] |
|
This is a load-on-startup servlet. You are correct, we had to add this to our web.xml instead of our module descriptor after upgrading to 3.6.3. |