You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org> on 2007/08/24 07:08:31 UTC

[jira] Resolved: (VELOCITY-536) Velocity Engine throws NullPointer Exception when two people click on the same page at the same time for the first time

     [ https://issues.apache.org/jira/browse/VELOCITY-536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Will Glass-Husain resolved VELOCITY-536.
----------------------------------------

    Resolution: Fixed

> Velocity Engine throws NullPointer Exception when two people click on the same page at the same time for the first time
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-536
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-536
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>            Reporter: Lei Gu
>             Fix For: 1.6
>
>         Attachments: 536-patch.txt, ASTDirective.java, ASTSetDirective.java, VelocimacroProxy.java
>
>
> Multi-thread concurrency issue
> During our concurrency testing, we observed NullPointer exceptions being thrown when two people hit the same page at the same time for the first time. Upon further investigation, it turns out that we need to synchronize the init method on ASTDirective, ASTSetDirective, and render method on ASTSetDirective, and VelocimacroProxy.
>  Basically, the problem is introduced as the following; when two threads attempts to parse and render the same template at the same time. Thread1 finishes parsing first and proceeds to the render method call, while thread 2 is still busy parsing and will overwrite the existing parse tree that is being used by thread 1 for rendering purpose. Thus under certainly condition a NullPointer exception will be thrown. 

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