五月 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". ----