Velocity中, Unable to find resource 'VM_global_library.vm' 问题解决办法


在tomcat等容器中发布带velocity的应用时, 出现 org.apache.velocity.exception.ResourceNotFoundException : Unable to find resource ...vm  的解决办法:

配置文件 velocity.properties 中, 如果有
resource . loader  =  file

file
. resource . loader . description  =  Velocity File Resource Loader
file
. resource . loader . class  =  org . apache . velocity . runtime . resource . loader . FileResourceLoader
file
. resource . loader . path  =   .
file
. resource . loader . cache  =  false
file
. resource . loader . modificationCheckInterval  =   2

这段, 全部注释掉即可.

若没有, 就在配置里写上以上内容, 并更改第三项为

file.resource.loader.class = org.apache.velocity.tools.view.WebappResourceLoader

你可能感兴趣的:(Velocity中, Unable to find resource 'VM_global_library.vm' 问题解决办法)