You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Johann Weber (JIRA)" <de...@velocity.apache.org> on 2009/05/15 21:53:45 UTC
[jira] Created: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
------------------------------------------------------------------------------------
Key: VELOCITY-717
URL: https://issues.apache.org/jira/browse/VELOCITY-717
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.6.2
Reporter: Johann Weber
Priority: Critical
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Resolved: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Will Glass-Husain resolved VELOCITY-717.
----------------------------------------
Resolution: Cannot Reproduce
resolving. try with the latest version (from svn head). if you still have this difficulty, please reopen the bug and give a little more detail. Thanks!
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Priority: Critical
> Fix For: 1.7
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858926#action_12858926 ]
Jarkko Viinamäki commented on VELOCITY-717:
-------------------------------------------
OK. I tracked down this bug. It happens in 1.6.2 but not in 1.7 (current head). To reproduce the bug is required that Velocity.VM_PERM_INLINE_LOCAL is set to true. Otherwise it doesn't happen as "namespaces" aren't enabled. See the attached testcase.
The Parse directive is implemented differently in 1.7 (Is the behaviour still the same?) and it avoids this bug.
The reason for this NPE is of course that the namespace parameter passed to VelocimacroManager.get is null. This eventually causes a call to Hashtable.get with a null key -> NPE.
The bug is in runtime.directive.Parse:
line 158: String arg = EventHandlerUtil.includeEvent( rsvc, context, sourcearg, context.getCurrentTemplateName(), getName());
// now arg can be null if IncludeEventHandler returns null
// then later in the same method
line 254: macroLibraries.add(arg);
Now the macroLibraries within the Context is "poisoned" by a null value. Then when we try to render some macro in runtime.directive.RuntimeMacro:
line 218: o = rsvc.getVelocimacro(macroName,
(String)macroLibraries.get(i), renderingTemplate);
Here macroLibraries.get(i) returns null and passes it to VelocimacroManager (namespace = null) and BOOM.
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Updated: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jarkko Viinamäki updated VELOCITY-717:
--------------------------------------
Attachment: test8.vm
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858933#action_12858933 ]
Jarkko Viinamäki commented on VELOCITY-717:
-------------------------------------------
This same bug is obviously in all 1.6.x releases. The bug is not present in 1.5. It slipped in in revision 568691 (2007-08-22).
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Updated: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Will Glass-Husain updated VELOCITY-717:
---------------------------------------
Fix Version/s: 1.7
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Priority: Critical
> Fix For: 1.7
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Reopened: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Will Glass-Husain reopened VELOCITY-717:
----------------------------------------
Assignee: Will Glass-Husain
I hit this recently in production code. I'm working to assemble a simple test case.
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Updated: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jarkko Viinamäki updated VELOCITY-717:
--------------------------------------
Attachment: macros2.vm
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Updated: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jarkko Viinamäki updated VELOCITY-717:
--------------------------------------
Attachment: Velocity717TestCase.java
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Updated: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Johann Weber (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johann Weber updated VELOCITY-717:
----------------------------------
Description:
The Engine throws an NPE if the IncludeEventHandler returns null.
(using merge method with a list of macro libs)
java.lang.NullPointerException
>> at java.util.Hashtable.get(Hashtable.java:333)
>> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
>> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
>> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
>> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
>> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
>> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
>> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
>> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
>> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
>> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
>> at org.apache.velocity.Template.merge(Template.java:328)
Environment: Suse Linux
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Priority: Critical
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Resolved: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna resolved VELOCITY-717.
-----------------------------------
Assignee: (was: Will Glass-Husain)
Fix Version/s: 1.6.x
Resolution: Fixed
Fixed. Thanks, Jarkko.
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Priority: Critical
> Fix For: 1.6.x, 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859363#action_12859363 ]
Nathan Bubna commented on VELOCITY-717:
---------------------------------------
Well, we have other unreleased fixes in the 1.6 branch, might as well fix this too. Perhaps we can muster the votes and effort for a 1.6.4 release.
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Assignee: Will Glass-Husain
> Priority: Critical
> Fix For: 1.7
>
> Attachments: macros2.vm, test8.vm, Velocity717TestCase.java
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] Commented: (VELOCITY-717) Engine throws an NPE using custom
macro libs if the IncludeEventHandler returns null
Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772828#action_12772828 ]
Will Glass-Husain commented on VELOCITY-717:
--------------------------------------------
Hi,
I tried to replicate this issue and couldn't. I tried merging in a macro library with Template.merge() as you suggest. I also tried doing #parse in the included file and referencing the macro in the parent file. Neither generated an NPE.
Can you please provide more details, ideally the VM and macro files you are using, and a code sample showing how you include the macros and merge the code.
> Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
> ------------------------------------------------------------------------------------
>
> Key: VELOCITY-717
> URL: https://issues.apache.org/jira/browse/VELOCITY-717
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2
> Environment: Suse Linux
> Reporter: Johann Weber
> Priority: Critical
> Fix For: 1.7
>
>
> The Engine throws an NPE if the IncludeEventHandler returns null.
> (using merge method with a list of macro libs)
> java.lang.NullPointerException
> >> at java.util.Hashtable.get(Hashtable.java:333)
> >> at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
> >> at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
> >> at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
> >> at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
> >> at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
> >> at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
> >> at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
> >> at org.apache.velocity.Template.merge(Template.java:328)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org