I think there is a bug in ASTStringLiteral (pure guess, it's getting late
here so I have to go). I'm having NPEs from time to time when putting
velocity in high load stress with 20 concurrent requests.

in ASTStringLiteral::value(InternalContextAdapter) i quickly changed the log
to have the full stacktrace and output the literal.

22 Feb 2002 19:32:44 [HttpProcessor[8080][6]] [ERROR] [velocity] - VM error
: hasRightsOnCurrentFolder. Null AST
22 Feb 2002 19:32:44 [HttpProcessor[8080][6]] [ERROR] [velocity] - Error in
interpolating string literal : #hasRightsOnCurrentFolder()
22 Feb 2002 19:32:44 [HttpProcessor[8080][6]] [ERROR] [velocity] -
java.lang.NullPointerException
        at java.io.Writer.write(Writer.java:107)
        at
org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java:99)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:27
1)
        at
org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLite
ral.java:183)
        at
org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirecti
ve.java:135)
        at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
        at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement
.java:109)
        at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
        at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement
.java:109)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:27
1)
        at
org.apache.velocity.runtime.directive.Parse.render(Parse.java:232)
        at
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.jav
a:153)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:27
1)
        at org.apache.velocity.Template.merge(Template.java:296)
        at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:492)
        at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:461)
[...]

It looks like child nodes are not initialized so I'm wondering if it is no
due to the if nodeTree == null that need to synchronized (yek !) or at least
it should be inited before being assigned, ie changed to:

SimpleNode tree  = rsvc.parse( br,context.getCurrentTemplateName() );

tree.init( context, rsvc );
nodeTree = tree;

I will do more testing by monday (throwing ThreadAlyzer) but this is my
first guess as of now so take this with the appropriate load of salt. :)

Stephane

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to