[MGNLCAT-89] Prevent NPEs at CategorySyndicator Created: 19/Aug/13 Updated: 28/Aug/13 Resolved: 27/Aug/13 |
|
| Status: | Closed |
| Project: | Magnolia Categorization Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.2.8, 2.0.3, 2.1 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Milan Divilek | Assignee: | Milan Divilek |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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
|
||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||
| Description |
|
When load feed from siteRoot which isn't exist then npe is thrown.
ERROR info.magnolia.module.rssaggregator.generator.AbstractSyndFeedGenerator 19.08.2013 11:45:01 -- Failed to generate Feed using generator 'info.magnolia.module.categorization.syndication.CategorySyndicator'
java.lang.NullPointerException
at info.magnolia.module.templatingkit.templates.category.TemplateCategoryUtil.findParentWithTemplateCategory(TemplateCategoryUtil.java:154)
at info.magnolia.module.templatingkit.templates.category.TemplateCategoryUtil.findParentWithTemplateCategory(TemplateCategoryUtil.java:147)
at info.magnolia.module.templatingkit.functions.STKTemplatingFunctions.siteRoot(STKTemplatingFunctions.java:263)
at info.magnolia.module.templatingkit.functions.STKTemplatingFunctions.siteRoot(STKTemplatingFunctions.java:217)
at info.magnolia.module.categorization.syndication.CategorySyndicator.loadFeedEntries(CategorySyndicator.java:108)
ERROR info.magnolia.module.rssaggregator.generator.AbstractSyndFeedGenerator 19.08.2013 11:45:01 -- Failed to generate Feed using generator 'info.magnolia.module.categorization.syndication.CategorySyndicator'
java.lang.NullPointerException
at info.magnolia.jcr.util.PropertyUtil.getString(PropertyUtil.java:346)
at info.magnolia.jcr.util.PropertyUtil.getString(PropertyUtil.java:336)
at info.magnolia.module.categorization.syndication.CategorySyndicator.setFeedInfo(CategorySyndicator.java:135)
|
| Comments |
| Comment by Jan Haderka [ 21/Aug/13 ] |
|
With this fix if someone is not using sites or has some trees that do not have any site defined, she/he can't use categorization to generate feeds of categories anymore. This is definitively not correct. Since sites are optional, categorization has to work fully also w/o it and assume search over whole workspace when you can't determine root of the site. |
| Comment by Jaroslav Simak [ 27/Aug/13 ] |
|
NPE is fixed, but another error pops up: 2013-08-27 11:56:49,335 ERROR .rssaggregator.generator.AbstractSyndFeedGenerator: Failed to generate Feed using generator 'info.magnolia.module.categorization.syndication.CategorySyndicator' com.sun.syndication.io.FeedException: Invalid rss_2.0 feed, missing channel link at com.sun.syndication.io.impl.RSS090Generator.checkNotNullAndLength(RSS090Generator.java:128) at com.sun.syndication.io.impl.RSS092Generator.checkChannelConstraints(RSS092Generator.java:139) at com.sun.syndication.io.impl.RSS090Generator.addChannel(RSS090Generator.java:97) at com.sun.syndication.io.impl.RSS091UserlandGenerator.addChannel(RSS091UserlandGenerator.java:77) at com.sun.syndication.io.impl.RSS091UserlandGenerator.populateFeed(RSS091UserlandGenerator.java:73 ) at com.sun.syndication.io.impl.RSS090Generator.generate(RSS090Generator.java:56) |