Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false"

简介: 五月 11, 2017 5:06:50 下午 freemarker.log._JULLoggerFactory$JULLogger error严重: Error executing FreeMarker templateFreeMarker template error:Can't con...
五月 11, 2017 5:06:50 下午 freemarker.log._JULLoggerFactory$JULLogger error
严重: Error executing FreeMarker template
FreeMarker template error:
Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false", which is the legacy default computer-language format, and hence isn't accepted.

----
Tip: If you just want "true"/"false" result as you are generting computer-language output, use "?c", like ${myBool?c}.
----
Tip: You can write myBool?string('yes', 'no') and like to specify boolean formatting in place.
----
Tip: If you need the same two values on most places, the programmers should set the "boolean_format" setting to something like "yes,no".
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${column.nullable?right_pad(5, " ")}  [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 61, column 84]
----

Java stack trace (for programmers):
----
freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...]
	at freemarker.core.Configurable.formatBoolean(Configurable.java:1001)
	at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:479)
	at freemarker.core.EvalUtil.coerceModelToStringOrUnsupportedMarkup(EvalUtil.java:420)
	at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107)
	at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34)
	at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29)
	at freemarker.core.Expression.eval(Expression.java:81)
	at freemarker.core.MethodCall._eval(MethodCall.java:58)
	at freemarker.core.Expression.eval(Expression.java:81)
	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:59)
	at freemarker.core.Environment.visit(Environment.java:362)
	at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:315)
	at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
	at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242)
	at freemarker.core.Environment.visitIteratorBlock(Environment.java:595)
	at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93)
	at freemarker.core.Environment.visit(Environment.java:326)
	at freemarker.core.Environment.visit(Environment.java:332)
	at freemarker.core.Environment.process(Environment.java:305)
	at freemarker.template.Template.process(Template.java:378)
	at cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent(Generator.java:233)
	at cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile(Generator.java:167)
	at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:126)
	at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:83)
	at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable(GeneratorFacade.java:117)
	at cn.org.rapid_framework.generator.GeneratorMain.main(GeneratorMain.java:76)

Exception in thread "main" java.lang.RuntimeException: generate 'Database Table:equipment to ClassName:Equipment' oucur error,template is:baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html
	at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:128)
	at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:83)
	at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable(GeneratorFacade.java:117)
	at cn.org.rapid_framework.generator.GeneratorMain.main(GeneratorMain.java:76)
Caused by: freemarker.core._MiscTemplateException: Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false", which is the legacy default computer-language format, and hence isn't accepted.

----
Tip: If you just want "true"/"false" result as you are generting computer-language output, use "?c", like ${myBool?c}.
----
Tip: You can write myBool?string('yes', 'no') and like to specify boolean formatting in place.
----
Tip: If you need the same two values on most places, the programmers should set the "boolean_format" setting to something like "yes,no".
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${column.nullable?right_pad(5, " ")}  [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 61, column 84]
----
	at freemarker.core.Configurable.formatBoolean(Configurable.java:1001)
	at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:479)
	at freemarker.core.EvalUtil.coerceModelToStringOrUnsupportedMarkup(EvalUtil.java:420)
	at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107)
	at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34)
	at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29)
	at freemarker.core.Expression.eval(Expression.java:81)
	at freemarker.core.MethodCall._eval(MethodCall.java:58)
	at freemarker.core.Expression.eval(Expression.java:81)
	at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:59)
	at freemarker.core.Environment.visit(Environment.java:362)
	at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:315)
	at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
	at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242)
	at freemarker.core.Environment.visitIteratorBlock(Environment.java:595)
	at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93)
	at freemarker.core.Environment.visit(Environment.java:326)
	at freemarker.core.Environment.visit(Environment.java:332)
	at freemarker.core.Environment.process(Environment.java:305)
	at freemarker.template.Template.process(Template.java:378)
	at cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent(Generator.java:233)
	at cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile(Generator.java:167)
	at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:126)
	... 3 more

这个错误其实错误信息中已经提示怎么处理了:

----
Tip: If you just want "true"/"false" result as you are generting computer-language output, use "?c", like ${myBool?c}.
----
Tip: You can write myBool?string('yes', 'no') and like to specify boolean formatting in place.
----
Tip: If you need the same two values on most places, the programmers should set the "boolean_format" setting to something like "yes,no".
----

目录
相关文章
|
5月前
|
JavaScript 前端开发 索引
JavaScript有7个数据类型:Number, String, Boolean, Null, Undefined, Symbol(BES6)和BigInt(ES10)组成基本类型
【6月更文挑战第25天】JavaScript有7个数据类型:Number, String, Boolean, Null, Undefined, Symbol(BES6)和BigInt(ES10)组成基本类型,而Object包括Array、Function等是引用类型。Objects可以包含键值对,Array是特殊的Object。Functions也是对象。`null`和`undefined`被视为特殊的原始值。
52 1
TS定义布尔值,let flag:boolean = true,定义数字类型 let a1:number = 10,赋值 let str1:string = ‘‘,打印c~.log($(str1))
TS定义布尔值,let flag:boolean = true,定义数字类型 let a1:number = 10,赋值 let str1:string = ‘‘,打印c~.log($(str1))
|
6月前
|
JavaScript 前端开发
js基础语法:包括变量声明、数据类型(Number, String, Boolean, Null, Undefined, Symbol, Object)、运算符、流程控制语句(if...else, switch, for, while, do...while)等。具体案例使用演示
js基础语法:包括变量声明、数据类型(Number, String, Boolean, Null, Undefined, Symbol, Object)、运算符、流程控制语句(if...else, switch, for, while, do...while)等。具体案例使用演示
74 1
|
6月前
|
JavaScript 前端开发
JavaScript基础语法:包括变量声明、数据类型(Number, String, Boolean, Null, Undefined, Symbol, Object)、运算符、流程控制语句(if...else, switch, for, while, do...while)等。
JavaScript基础语法:包括变量声明、数据类型(Number, String, Boolean, Null, Undefined, Symbol, Object)、运算符、流程控制语句(if...else, switch, for, while, do...while)等。
64 0
|
XML 数据格式
解决 Cannot convert value of type ‘java.lang.String‘ to required type ‘java.sql.Driver‘ for property ‘
解决 Cannot convert value of type ‘java.lang.String‘ to required type ‘java.sql.Driver‘ for property ‘
305 0
|
存储 JavaScript 前端开发
JavaScript】基本数据类型与引用数据类型区别(及为什么String、Boolean、Number基本数据类型会有属性和方法?)
JavaScript】基本数据类型与引用数据类型区别(及为什么String、Boolean、Number基本数据类型会有属性和方法?)
97 0
|
Java
SpingBoot2.x文件上传:failed to convert java.lang.String to org.springframework.util.unit.DataSize
SpingBoot2.x文件上传:failed to convert java.lang.String to org.springframework.util.unit.DataSize
401 0
|
Java
【Java用法】Boolean.parseBoolean(string);
Boolean.parseBoolean(string); String类型转boolean类型的一个方法 当String的值为“true”时返回true,(此处true值是忽略大小写的) 当为其他字符串时返回false。
195 0
|
Java 数据库连接
Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate';
Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate';
787 0

热门文章

最新文章