You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Hanson, Gregory" <Gr...@getthere.com> on 2004/07/12 18:33:00 UTC

template initialization throwing error on runtime.interpolate.string.literals property

I'm in the process of migrating an application from WebLogic 6.1 to JBoss 3.x.   I've successfully deployed the application against my source tree on JBoss 3.x and requested that the migrated codebase be added to the repository.  Upon a new instance of the same codebase I've run into a weird exception on the initialization of any template.  I tried breaking the issue down to the simplest of examples for which I have tested the following basic template and it fails:  

#set ( $somevar = "1234" )
$somevar

Any suggestions on why the template is not initializing properly?  Are there additional configs I'm not aware of or need to check?  Thanks in advance.

The following is my velocity.properties file:


#
#  the following are specified relative to the
#  root of the webapp because the
#  ControllerServlet will setup these
#  properties with the right real path
#  prepended
#
#
# specify three resource loaders to use
#
resource.loader = file

#
# for the loader we call 'file', set the FileResourceLoader as the
# class to use, turn off caching, and use 3 directories for templates
#
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = ./templates, ./scripts
#file.resource.loader.cache = false
#file.resource.loader.modificationCheckInterval = 0

runtime.log = ./WEB-INF/logs/velocity.log
runtime.log.invalid.references = true
#runtime.interpolate.string.literals = true


directive.foreach.counter.name = velocityCount
directive.foreach.counter.initial.value = 1

velocimacro.library = globalmacros.vm
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = true
velocimacro.permissions.allow.inline.local.scope = false
velocimacro.context.localscope = false
velocimacro.library.autoreload = true



The following stacktrace is rendered to stderr:

11:13:39,347 ERROR [STDERR] java.lang.ClassCastException: 'runtime.interpolate.string.literals' doesn't map to a Boolean object
11:13:39,349 ERROR [STDERR]     at org.apache.commons.collections.ExtendedProperties.getBoolean(ExtendedProperties.java:1258)
11:13:39,349 ERROR [STDERR]     at org.apache.commons.collections.ExtendedProperties.getBoolean(ExtendedProperties.java:1216)
11:13:39,350 ERROR [STDERR]     at org.apache.velocity.runtime.RuntimeInstance.getBoolean(RuntimeInstance.java:1075)
11:13:39,350 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.ASTStringLiteral.init(ASTStringLiteral.java:116)
11:13:39,351 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,352 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.ASTSetDirective.init(ASTSetDirective.java:110)
11:13:39,352 ERROR [STDERR]     at org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,353 ERROR [STDERR]     at org.apache.velocity.Template.initDocument(Template.java:239)
11:13:39,353 ERROR [STDERR]     at org.apache.velocity.Template.process(Template.java:164)
11:13:39,353 ERROR [STDERR]     at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:466)
11:13:39,353 ERROR [STDERR]     at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:384)
11:13:39,354 ERROR [STDERR]     at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:814)
11:13:39,354 ERROR [STDERR]     at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:796)
11:13:39,354 ERROR [STDERR]     at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:337)
11:13:39,355 ERROR [STDERR]     at org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java:540)
11:13:39,355 ERROR [STDERR]     at com.getthere.common.servlet.DMBaseServlet.getTemplateByName(Unknown Source)
11:13:39,355 ERROR [STDERR]     at com.getthere.common.servlet.UtilityServlet.handleRequest(Unknown Source)
11:13:39,356 ERROR [STDERR]     at org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:372)
11:13:39,356 ERROR [STDERR]     at org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
11:13:39,356 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
11:13:39,356 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
11:13:39,357 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
11:13:39,357 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
11:13:39,357 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
11:13:39,358 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
11:13:39,358 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,358 ERROR [STDERR]     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,358 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
11:13:39,359 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
11:13:39,359 ERROR [STDERR]     at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
11:13:39,359 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
11:13:39,360 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,360 ERROR [STDERR]     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,360 ERROR [STDERR]     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
11:13:39,361 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
11:13:39,361 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
11:13:39,361 ERROR [STDERR]     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
11:13:39,362 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
11:13:39,362 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
11:13:39,362 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
11:13:39,363 ERROR [STDERR]     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
11:13:39,363 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
11:13:39,363 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,363 ERROR [STDERR]     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,364 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
11:13:39,364 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
11:13:39,364 ERROR [STDERR]     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,365 ERROR [STDERR]     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,365 ERROR [STDERR]     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
11:13:39,365 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
11:13:39,365 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
11:13:39,366 ERROR [STDERR]     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
11:13:39,366 ERROR [STDERR]     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
11:13:39,366 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:534)
11:13:39,367 INFO  [STDOUT] Error java.lang.ClassCastException: 'runtime.interpolate.string.literals' doesn't map to a Boolean object



Greg Hanson
Senior  Software Developer
Sabre Corporate Solutions/Travelocity/DirectMeetings

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: template initialization throwing error on runtime.interpolate.string.literals property

Posted by Will Glass-Husain <wg...@forio.com>.
Looked into this briefly.  Seems very strange.

-- What version of Velocity?
-- Do you have multiple velocity jars in the classpath?  Maybe one at the
app server level and one in your webapp?
--When you uncomment the line "runtime.interpolate.string.literals" does it
work?
--Is there anything unusual about that line?  Any extra spaces at the end of
the line?

I'm theorizing there's some type of version conflict.  Maybe with the wrong
commons collection jar (which is a dependency).  Or maybe between two
versions of velocity.  (Looking at cvs, the name of the property changed
some time ago, so perhaps it can't find the default property value).

Best,
WILL

----- Original Message ----- 
From: "Hanson, Gregory" <Gr...@getthere.com>
To: <ve...@jakarta.apache.org>
Sent: Monday, July 12, 2004 9:33 AM
Subject: template initialization throwing error on
runtime.interpolate.string.literals property


I'm in the process of migrating an application from WebLogic 6.1 to JBoss
3.x.   I've successfully deployed the application against my source tree on
JBoss 3.x and requested that the migrated codebase be added to the
repository.  Upon a new instance of the same codebase I've run into a weird
exception on the initialization of any template.  I tried breaking the issue
down to the simplest of examples for which I have tested the following basic
template and it fails:

#set ( $somevar = "1234" )
$somevar

Any suggestions on why the template is not initializing properly?  Are there
additional configs I'm not aware of or need to check?  Thanks in advance.

The following is my velocity.properties file:


#
#  the following are specified relative to the
#  root of the webapp because the
#  ControllerServlet will setup these
#  properties with the right real path
#  prepended
#
#
# specify three resource loaders to use
#
resource.loader = file

#
# for the loader we call 'file', set the FileResourceLoader as the
# class to use, turn off caching, and use 3 directories for templates
#
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = ./templates, ./scripts
#file.resource.loader.cache = false
#file.resource.loader.modificationCheckInterval = 0

runtime.log = ./WEB-INF/logs/velocity.log
runtime.log.invalid.references = true
#runtime.interpolate.string.literals = true


directive.foreach.counter.name = velocityCount
directive.foreach.counter.initial.value = 1

velocimacro.library = globalmacros.vm
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = true
velocimacro.permissions.allow.inline.local.scope = false
velocimacro.context.localscope = false
velocimacro.library.autoreload = true



The following stacktrace is rendered to stderr:

11:13:39,347 ERROR [STDERR] java.lang.ClassCastException:
'runtime.interpolate.string.literals' doesn't map to a Boolean object
11:13:39,349 ERROR [STDERR]     at
org.apache.commons.collections.ExtendedProperties.getBoolean(ExtendedPropert
ies.java:1258)
11:13:39,349 ERROR [STDERR]     at
org.apache.commons.collections.ExtendedProperties.getBoolean(ExtendedPropert
ies.java:1216)
11:13:39,350 ERROR [STDERR]     at
org.apache.velocity.runtime.RuntimeInstance.getBoolean(RuntimeInstance.java:
1075)
11:13:39,350 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.ASTStringLiteral.init(ASTStringLiter
al.java:116)
11:13:39,351 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,351 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,352 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.ASTSetDirective.init(ASTSetDirective
.java:110)
11:13:39,352 ERROR [STDERR]     at
org.apache.velocity.runtime.parser.node.SimpleNode.init(SimpleNode.java:242)
11:13:39,353 ERROR [STDERR]     at
org.apache.velocity.Template.initDocument(Template.java:239)
11:13:39,353 ERROR [STDERR]     at
org.apache.velocity.Template.process(Template.java:164)
11:13:39,353 ERROR [STDERR]     at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(Resour
ceManagerImpl.java:466)
11:13:39,353 ERROR [STDERR]     at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Resourc
eManagerImpl.java:384)
11:13:39,354 ERROR [STDERR]     at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java
:814)
11:13:39,354 ERROR [STDERR]     at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java
:796)
11:13:39,354 ERROR [STDERR]     at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.ja
va:337)
11:13:39,355 ERROR [STDERR]     at
org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java
:540)
11:13:39,355 ERROR [STDERR]     at
com.getthere.common.servlet.DMBaseServlet.getTemplateByName(Unknown Source)
11:13:39,355 ERROR [STDERR]     at
com.getthere.common.servlet.UtilityServlet.handleRequest(Unknown Source)
11:13:39,356 ERROR [STDERR]     at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
72)
11:13:39,356 ERROR [STDERR]     at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
11:13:39,356 ERROR [STDERR]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
11:13:39,356 ERROR [STDERR]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
11:13:39,357 ERROR [STDERR]     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
11:13:39,357 ERROR [STDERR]     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
11:13:39,357 ERROR [STDERR]     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
11:13:39,358 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
11:13:39,358 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,358 ERROR [STDERR]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,358 ERROR [STDERR]     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
11:13:39,359 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
11:13:39,359 ERROR [STDERR]     at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
11:13:39,359 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
11:13:39,360 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,360 ERROR [STDERR]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,360 ERROR [STDERR]     at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
11:13:39,361 ERROR [STDERR]     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
11:13:39,361 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
11:13:39,361 ERROR [STDERR]     at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
11:13:39,362 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
11:13:39,362 ERROR [STDERR]     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
11:13:39,362 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
11:13:39,363 ERROR [STDERR]     at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
11:13:39,363 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
11:13:39,363 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,363 ERROR [STDERR]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,364 ERROR [STDERR]     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
11:13:39,364 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
11:13:39,364 ERROR [STDERR]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
11:13:39,365 ERROR [STDERR]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
11:13:39,365 ERROR [STDERR]     at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
11:13:39,365 ERROR [STDERR]     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
11:13:39,365 ERROR [STDERR]     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
11:13:39,366 ERROR [STDERR]     at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
11:13:39,366 ERROR [STDERR]     at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
11:13:39,366 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:534)
11:13:39,367 INFO  [STDOUT] Error java.lang.ClassCastException:
'runtime.interpolate.string.literals' doesn't map to a Boolean object



Greg Hanson
Senior  Software Developer
Sabre Corporate Solutions/Travelocity/DirectMeetings

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org