Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring Boot+Velocity在启动时生成异常_Java_Spring_Spring Boot - Fatal编程技术网

Java Spring Boot+Velocity在启动时生成异常

Java Spring Boot+Velocity在启动时生成异常,java,spring,spring-boot,Java,Spring,Spring Boot,我目前正在测试使用SpringBoot部署Freemarker应用程序。 事实上,我的简单测试运行良好。但在我的日志中,我看到了以下例外情况,我想知道它可能是什么: 2014-08-14 15:03:26.774 +0000 DEBUG [ main] [o.s.w.servlet.view.freemarker.FreeMarkerConfigurer:346] - Cannot resolve template loader path [

我目前正在测试使用SpringBoot部署Freemarker应用程序。 事实上,我的简单测试运行良好。但在我的日志中,我看到了以下例外情况,我想知道它可能是什么:

2014-08-14 15:03:26.774 +0000 DEBUG         [                main]    [o.s.w.servlet.view.freemarker.FreeMarkerConfigurer:346] -  Cannot resolve template loader path [classpath:/templates/] to [java.io.File]: using SpringTemplateLoader as fallback  
java.io.FileNotFoundException: class path resource [templates/] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/htmlconverter.jar!/templates/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:207) ~[spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
但我的模板使用正确。这种例外情况正常吗?
注意,我们没有使用Spring引导父pom。我们正在使用自己的父级。

这是一个调试日志。我认为这会使它变得不可忽略。

您必须在/src/main/resources/中创建一个/templates文件夹,并且它必须包含velocity文件,或者您可以在@EnableAutoConfiguration中使用exclude跳过自动配置。

添加下面的配置将解决此问题! spring.velocity.preference file system access=false spring.velocity.prefix=/templates