Re: Odd observation during debugging

Christopher Schultz <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <[email protected]>
Nathan,

On 7/11/12 12:28 PM, Nathan Bubna wrote:
> Just set:
> directive.if.tostring.nullcheck = false

We just went into production last night after testing in this
configuration for months, and we're getting this bizarre error message
that filled-up our logs files and the whole disk on the server.

Obviously, the root cause is at the bottom.:

INFO:  Velocity  [error] Could not initialize VelocityEngine -
org.apache.veloci
ty.exception.VelocityException: Velocimacro : Error using VM library :
/WEB-INF/
VM_global_library.vm
org.apache.velocity.exception.VelocityException: Velocimacro : Error
using VM li
brary : /WEB-INF/VM_global_library.vm
        at
org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(Veloci
macroFactory.java:219)
        at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java
:274)
...
Caused by: org.apache.velocity.exception.VelocityException: Exception
thrown pro
cessing Template /WEB-INF/VM_global_library.vm
        at org.apache.velocity.Template.process(Template.java:164)
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource
(ResourceManagerImpl.java:437)
        at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(
ResourceManagerImpl.java:352)
        at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstan
ce.java:1533)
        at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstan
ce.java:1514)
        at
org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(Veloci
macroFactory.java:202)
        ... 28 more

Caused by: java.lang.ClassCastException:
'directive.if.tostring.nullcheck' doesn't map to a Boolean object
        at
org.apache.commons.collections.ExtendedProperties.getBoolean(Extended
Properties.java:1190)
        at
org.apache.commons.collections.ExtendedProperties.getBoolean(Extended
Properties.java:1157)
        at
org.apache.velocity.runtime.RuntimeInstance.getBoolean(RuntimeInstanc
e.java:1822)
        at
org.apache.velocity.runtime.parser.node.ASTReference.init(ASTReferenc
e.java:141)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.ja
va:309)
        at
org.apache.velocity.runtime.parser.node.ASTDirective.init(ASTDirectiv
e.java:95)
        at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.ja
va:309)
        at org.apache.velocity.Template.initDocument(Template.java:227)
        at org.apache.velocity.Template.process(Template.java:135)
        ... 33 more

I'm going to temporarily remove this directive to get back up and
running, and I'll be looking at the code to see what's going on. If
anyone can make a suggestion in the meantime, I'm all ears.

I'm running Velocity 1.7 and Velocity Tools 2.0 with a few extra patches.

Thanks,
-chris
signature.asc (application/pgp-signature, 306 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDhi+8ACgkQ9CaO5/Lv0PAZxACfc/CTpqcuaLTNCtCemfrdmwj4
joQAoLm1LilhXwNXpfu8i/vy9FLa8aKE
=px0d
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.