You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Siri C. (JIRA)" <de...@velocity.apache.org> on 2009/06/22 11:54:07 UTC

[jira] Created: (VELOCITY-728) NullPointerException occurs when #parse() without parameter

NullPointerException occurs when #parse() without parameter
-----------------------------------------------------------

                 Key: VELOCITY-728
                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.6.2
            Reporter: Siri C.


Execute this template code

#parse()

The exception occurs
Caused by: java.lang.NullPointerException
	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
	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.RuntimeInstance.render(RuntimeInstance.java:1277)
	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
	... 6 more


-- 
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-728) NullPointerException occurs when #parse() without parameter

Posted by "Siri C. (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765964#action_12765964 ] 

Siri C. commented on VELOCITY-728:
----------------------------------

Yes, please improve an error message.
Because we can't find a position of error on template code.

> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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-728) NullPointerException occurs when #parse() without parameter

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722607#action_12722607 ] 

Nathan Bubna commented on VELOCITY-728:
---------------------------------------

Just to make sure you know, you can't use #parse without an argument identifying which file you wish to parse.

What were you hoping/expecting to happen?  A better error message? That's a fine idea, but that hardly qualifies as a "Major" bug.

> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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] Issue Comment Edited: (VELOCITY-728) NullPointerException occurs when #parse() without parameter

Posted by "Pakornpong Pothipruk (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766494#action_12766494 ] 

Pakornpong Pothipruk edited comment on VELOCITY-728 at 10/16/09 3:05 AM:
-------------------------------------------------------------------------

When I use Velocity on an RTF document, I would like Velocity to also tell me that the exception (e.g. one above) occurs on which line of my RTF document. Is that possible with the current engine?

      was (Author: pakornpong_p):
    When I use Velocity on an RTF document, I would like Velocity to also tell me that the exception (e.g. one above) occurs on which line of my RTF document.
  
> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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-728) NullPointerException occurs when #parse() without parameter

Posted by "Pakornpong Pothipruk (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766494#action_12766494 ] 

Pakornpong Pothipruk commented on VELOCITY-728:
-----------------------------------------------

When I use Velocity on an RTF document, I would like Velocity to also tell me that the exception (e.g. one above) occurs on which line of my RTF document.

> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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-728) NullPointerException occurs when #parse() without parameter

Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarkko Viinamäki updated VELOCITY-728:
--------------------------------------

    Attachment: velocity-728.patch

This should fix it. 

If #parse doesn't get an argument, a VelocityException is thrown with information where the problem occurs.

The previous code didn't obviously work and instead of throwing exceptions it just wrote things to Velocity log. This same problem is related to other directives as well (no checking whether we actually got the argument or not and no exception in case of error).

> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>         Attachments: velocity-728.patch
>
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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-728) NullPointerException occurs when #parse() without parameter

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-728.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7

Thanks, Jarkko.  We really need to get you committing your own patches. :)

> NullPointerException occurs when #parse() without parameter
> -----------------------------------------------------------
>
>                 Key: VELOCITY-728
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-728
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Siri C.
>             Fix For: 1.7
>
>         Attachments: velocity-728.patch
>
>
> Execute this template code
> #parse()
> The exception occurs
> Caused by: java.lang.NullPointerException
> 	at org.apache.velocity.runtime.parser.node.SimpleNode.jjtGetChild(SimpleNode.java:177)
> 	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:131)
> 	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.RuntimeInstance.render(RuntimeInstance.java:1277)
> 	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
> 	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:294)
> 	... 6 more

-- 
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