SpringBoot1.5 integrates velocity newspaper ResourceNotFoundException

the project structure is as follows:

clipboard.png

load Velocity code:

@Bean
public VelocityEngine getVelocityEngine() throws IOException {
    logger.info("MyWebMvcConfiguration VelocityEngine");
    return getVelocityConfigurer().getVelocityEngine();
}
@Bean
public VelocityConfigurer getVelocityConfigurer() {
    logger.info("MyWebMvcConfiguration VelocityConfigurer");
    VelocityConfigurer velocityConfigurer = new VelocityConfigurer();
    velocityConfigurer.setResourceLoaderPath("/page/");
    Properties velocityProperties = new Properties();
    velocityProperties.put("output.encoding", "UTF-8");
    velocityProperties.put("input.encoding", "UTF-8");
    velocityProperties.put("contentType", "text/html;charset=UTF-8");
    velocityProperties.put("velocimacro.library", "views/common/macro.vm");
    velocityProperties.put("velocimacro.library.autoreload", true);
    velocityConfigurer.setVelocityProperties(velocityProperties);
    return velocityConfigurer;
}

the error message is as follows:
Caused by: org.apache.velocity.exception.VelocityException: Velocimacro: Error using VM library: views/common/macro.vm

at org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(VelocimacroFactory.java:219)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:274)
at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:93)
at org.springframework.ui.velocity.VelocityEngineFactory.createVelocityEngine(VelocityEngineFactory.java:251)
at org.springframework.web.servlet.view.velocity.VelocityConfigurer.afterPropertiesSet(VelocityConfigurer.java:121)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1689)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1627)
... 35 common frames omitted

Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource "views/common/macro.vm"

at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:474)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:352)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1533)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1514)
at org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(VelocimacroFactory.java:202)
... 41 common frames omitted
The

macro.vm file is in resource- > page- > views- > common.


views/common/macro.vm-> / page/views/common/macro.vm

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44af8-5905a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44af8-5905a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?