亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

freemarker頁面啟動無法訪問

2018-12-09 15:01:40.575? WARN 9784 --- [? restartedMain] ationConfigEmbeddedWebApplicationContext : 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/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.FreeMarkerAutoConfiguration$FreeMarkerWebConfiguration': Unsatisfied dependency expressed through field 'properties': 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, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors

Field error in object 'spring.freemarker' on field 'charset': rejected value [UTF-8 ]; codes [typeMismatch.spring.freemarker.charset,typeMismatch.charset,typeMismatch.java.nio.charset.Charset,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [spring.freemarker.charset,charset]; arguments []; default message [charset]]; default message [Failed to convert property value of type [java.lang.String] to required type [java.nio.charset.Charset] for property 'charset'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.nio.charset.Charset]]; nested exception is org.springframework.beans.factory.BeanCreationException: 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, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors

Field error in object 'spring.freemarker' on field 'charset': rejected value [UTF-8 ]; codes [typeMismatch.spring.freemarker.charset,typeMismatch.charset,typeMismatch.java.nio.charset.Charset,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [spring.freemarker.charset,charset]; arguments []; default message [charset]]; default message [Failed to convert property value of type [java.lang.String] to required type [java.nio.charset.Charset] for property 'charset'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.nio.charset.Charset]]

2018-12-09 15:01:40.585? INFO 9784 --- [? restartedMain] o.apache.catalina.core.StandardService? ?: Stopping service Tomcat

2018-12-09 15:01:40.608? INFO 9784 --- [? restartedMain] utoConfigurationReportLoggingInitializer :?


Error starting ApplicationContext. To display the auto-configuration report enable debug logging (start with --debug)



2018-12-09 15:01:40.625 ERROR 9784 --- [? restartedMain] o.s.b.d.LoggingFailureAnalysisReporter? ?:?


***************************

APPLICATION FAILED TO START

***************************


正在回答

2 回答

報錯信息里面已經說了,是在配置spring.freemarker的charset屬性出錯了,無法將UTF-8進行轉換,但是屬性和值應該都沒問題,你檢查一下你的UTF-8后面是不是有個空格,多了這個空格,就會導致無法識別編碼,properties文件的=后面的值,前面可以加空格,但是后面千萬不能亂加空格

0 回復 有任何疑惑可以回復我~

是不是在application.properties里面的配置有誤

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

freemarker頁面啟動無法訪問

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號