wangsm 发表于 2018-7-5 12:54:32

Oline在线表单的代码生成BUG

在使用3.7.6的Online在线开发的代码生成时报如下错误
表单编辑里面删除了原来默认的最后三个字段,自己添加了三个字段。
页面属性里面,自己添加的字段中有两个字段我选择的控件类型是下拉框
校验字典里面选择下拉框的两个字段对应的字典Code是数据字典里面的字典Code。
配置好后执行代码生成就报这个错。 Template processing error: "Expression po.dictTable is undefined on line 66, column 339 in naturebt\\single\\webapp\\webpage\\${bussiPackage}\\${entityPackage}\\${entityNameUncapFirst}-add.jspi."

Expression po.dictTable is undefined on line 66, column 339 in naturebt\single\webapp\webpage\${bussiPackage}\${entityPackage}\${entityNameUncapFirst}-add.jspi.
The problematic instruction:
----------
==> ${po.dictTable}
in user-directive dictInfo
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression po.dictTable is undefined on line 66, column 339 in naturebt\single\webapp\webpage\${bussiPackage}\${entityPackage}\${entityNameUncapFirst}-add.jspi.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.renderElementToString(Environment.java:1594)
        at freemarker.core.StringLiteral.getStringValue(StringLiteral.java:101)
        at freemarker.core.StringLiteral._getAsTemplateModel(StringLiteral.java:86)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Environment.visit(Environment.java:568)
        at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.IfBlock.accept(IfBlock.java:82)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
        at freemarker.core.Environment.visit(Environment.java:428)
        at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.process(Environment.java:199)
        at freemarker.template.Template.process(Template.java:259)
        at org.jeecgframework.codegenerate.extcommon.FreemarkerHelper.processTemplate(FreemarkerHelper.java:79)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.generateNewFileOrInsertIntoFile(BaseCodeExtCommonFactory.java:182)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.executeGenerate(BaseCodeExtCommonFactory.java:113)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.scanTemplatesAndProcess(BaseCodeExtCommonFactory.java:79)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.generateFileCommon(BaseCodeExtCommonFactory.java:59)
        at org.jeecgframework.codegenerate.extcommon.single.CgformCodeExtCommonFactory.generateFileCommon(CgformCodeExtCommonFactory.java:35)
        at org.jeecgframework.codegenerate.extcommon.single.CgformCodeExtCommonFactory.invokeCommon(CgformCodeExtCommonFactory.java:76)
        at org.jeecgframework.codegenerate.extcommon.single.CgformCodeExtCommonGenerate.generateToFile(CgformCodeExtCommonGenerate.java:176)
        at org.jeecgframework.web.cgform.controller.generate.GenerateController.dogenerate(GenerateController.java:247)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:676)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.jeecgframework.core.aop.GZipFilter.doFilter(GZipFilter.java:152)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

admin 发表于 2018-7-5 13:16:02

老问题,手工判断下po.dictTable 为空

wangsm 发表于 2018-7-5 14:26:44

admin 发表于 2018-7-5 13:16 static/image/common/back.gif
老问题,手工判断下po.dictTable 为空

我是在点击代码生成,然后填写好包名后直接点击确定,就报错了,还没有生成成功代码呢。

wangsm 发表于 2018-7-5 15:28:16

admin 发表于 2018-7-5 13:16 static/image/common/back.gif
老问题,手工判断下po.dictTable 为空

管理,我需要怎么判断呢,麻烦指点一下,谢谢。

wangsm 发表于 2018-7-5 17:03:51

admin 发表于 2018-7-5 13:16 static/image/common/back.gif
老问题,手工判断下po.dictTable 为空

在oracle下面报错,但是在mysql 下面就正常,这是不是bug,在oracl下面时需要怎么修改,求指点,谢谢。

admin 发表于 2018-7-5 19:39:28

http://www.jeecg.org/forum.php?mod=viewthread&tid=5663&page=1

wangsm 发表于 2018-7-5 23:33:27

admin 发表于 2018-7-5 19:39 static/image/common/back.gif
http://www.jeecg.org/forum.php?mod=viewthread&tid=5663&page=1

可以了,谢谢。还有另外一个问题是,在mysql下编辑表单,如果不更改字段的情况下点击确定,是不需要重新同步数据库的,如果是oracle下,点击编辑表单,什么都不改,直接点击确定,状态还是会变成未同步。
页: [1]
查看完整版本: Oline在线表单的代码生成BUG