Details
-
Bug
-
Resolution: Won't Fix
-
Low
-
None
-
2.10
Description
Adding white space in atlassian-plugin.xml cause Confluence to throw exceptions saying that it cannot find the velocity templates.
For example, the xml was changed from
<result name="input" type="velocity">/templates/extra/myplugin/add-item.vm</result>
to
<result name="input" type="velocity"> /templates/extra/myplugin/add-item.vm </result>
after formatting. It would appear that you should remove trailing and leading blanks/tabs from the value before using it to retrieve the velocity pages.
Here's the first part of the exception (note the extra white space):
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/agilent/labs/ /templates/extra/myplugin/add-item.vm ' at com.atlassian.confluence.util.velocity.ConfigurableResourceManager.loadResource(ConfigurableResourceManager.java:400) at com.atlassian.confluence.util.velocity.ConfigurableResourceManager.getResource(ConfigurableResourceManager.java:304) at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102) at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1077) at org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:528)
This is because we do not ignore white spaces when parsing XML documents.