Failed to bind properties under 'spring.freemarker.expose-request-attributes' to boolean:如何处理

我真的看不懂 发布于 04/23 11:55
阅读 121
收藏 0

2019-04-23 11:23:41.064  INFO 18504 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-04-23 11:23:41.860  INFO 18504 --- [  restartedMain] o.h.h.i.QueryTranslatorFactoryInitiator  : HHH000397: Using ASTQueryTranslatorFactory
2019-04-23 11:23:42.587  INFO 18504 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-04-23 11:23:42.872  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3f2687a1: startup date [Tue Apr 23 11:23:31 CST 2019]; root of context hierarchy
2019-04-23 11:23:42.994  WARN 18504 --- [  restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2019-04-23 11:23:43.111  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/A1]}" onto public java.lang.String org.spring_boot_A1.A1Controller.A1()
2019-04-23 11:23:43.115  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/getDemo]}" onto public org.spring_boot_A1.Demo org.spring_boot_A1.A1Controller.getDemo()
2019-04-23 11:23:43.120  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/delete]}" onto public java.lang.String org.spring_boot_A1.demo.controller.CatController.delete()
2019-04-23 11:23:43.120  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/save]}" onto public java.lang.String org.spring_boot_A1.demo.controller.CatController.save()
2019-04-23 11:23:43.121  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/getAll]}" onto public java.lang.Iterable<org.spring_boot_A1.demo.bean.Cat> org.spring_boot_A1.demo.controller.CatController.getAll()
2019-04-23 11:23:43.122  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/selectByCatName]}" onto public org.spring_boot_A1.demo.bean.Cat org.spring_boot_A1.demo.controller.CatController.selectByCatName(java.lang.String)
2019-04-23 11:23:43.123  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/findByCatName2]}" onto public org.spring_boot_A1.demo.bean.Cat org.spring_boot_A1.demo.controller.CatController.findByCatName2(java.lang.String)
2019-04-23 11:23:43.123  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cat/findByCatName]}" onto public org.spring_boot_A1.demo.bean.Cat org.spring_boot_A1.demo.controller.CatController.findByCatName(java.lang.String)
2019-04-23 11:23:43.135  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/templates/hello]}" onto public java.lang.String org.spring_boot_A1.TemplatesController.hello(java.util.Map<java.lang.String, java.lang.Object>)
2019-04-23 11:23:43.135  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/templates/helloftl]}" onto public java.lang.String org.spring_boot_A1.TemplatesController.helloftl()
2019-04-23 11:23:43.140  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2019-04-23 11:23:43.142  INFO 18504 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2019-04-23 11:23:43.247  INFO 18504 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-04-23 11:23:43.247  INFO 18504 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-04-23 11:23:43.285  INFO 18504 --- [  restartedMain] .m.m.a.ExceptionHandlerExceptionResolver : Detected @ExceptionHandler methods in globalDefaultExceptionHandler
2019-04-23 11:23:43.436  WARN 18504 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'viewResolver' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.freemarker.FreeMarkerServletWebConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.freemarker-org.springframework.boot.autoconfigure.freemarker.FreeMarkerProperties': Could not bind properties to 'FreeMarkerProperties' : prefix=spring.freemarker, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.freemarker.expose-request-attributes' to boolean
2019-04-23 11:23:43.458  INFO 18504 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-04-23 11:23:43.461  INFO 18504 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-04-23 11:23:43.485  INFO 18504 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2019-04-23 11:23:43.489  INFO 18504 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-04-23 11:23:43.556  INFO 18504 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-23 11:23:43.563 ERROR 18504 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'spring.freemarker.expose-request-attributes' to boolean:

    Property: spring.freemarker.expose-request-attributes
    Value: fase
    Origin: class path resource [application.properties]:48:45
    Reason: failed to convert java.lang.String to boolean

Action:

Update your application's configuration

在spring boot 中引入freemarker模板,启动时报错

麻烦知道的大佬讲一下,已经僵持1个小时了

加载中
0
我真的看不懂
我真的看不懂

问题已解决,模板配置下,spring.freemarker.expose-request-attributes没写全

返回顶部
顶部