shenyu 发表于 2018-8-7 18:50:09

代码生成器生成一对多代码,无法生成主表的jsp页面

在online表单开发中设计了几张一对多的表,在点击生成代码时发现主表的list.jsp页面没有生成,打开页面显示如下代码:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>

Error reading included file multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/../../ui/tdgColcb.ftl
The problematic instruction:
----------
==> include "../../ui/tdgColcb.ftl"
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error reading included file multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/../../ui/tdgColcb.ftl
        at freemarker.core.Include.accept(Include.java:167)
        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:185)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.executeGenerate(BaseCodeExtCommonFactory.java:116)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.scanTemplatesAndProcess(BaseCodeExtCommonFactory.java:82)
        at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.generateFileCommon(BaseCodeExtCommonFactory.java:62)
        at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonFactory.generateFileCommon(CgformCodeOne2ManyExtCommonFactory.java:36)
        at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonFactory.invokeCommon(CgformCodeOne2ManyExtCommonFactory.java:77)
        at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonGenerate.generateToFile(CgformCodeOne2ManyExtCommonGenerate.java:241)
        at org.jeecgframework.web.cgform.controller.generate.GenerateController.dogenerateOne2Many(GenerateController.java:353)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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:647)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.jeecgframework.core.aop.GZipFilter.doFilter(GZipFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        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:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        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:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.FileNotFoundException: Template multitable/onetomany/webapp/webpage/${bussiPackage}/${entityPackage}/../../ui/tdgColcb.ftl not found.
        at freemarker.template.Configuration.getTemplate(Configuration.java:580)
        at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
        at freemarker.core.Include.accept(Include.java:157)
        ... 64 more
不知道有没有大佬碰到过这样的问题,烦请指点一二。

admin 发表于 2018-8-7 19:06:59

第一步:修改下pom 把freeemarker引用改成<!-- freemarker -->
                <dependency>
                  <groupId>org.freemarker</groupId>
                  <artifactId>freemarker</artifactId>
                  <version>${freemarker.version}</version>
                  <scope>system</scope>
                  <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/freemarker-null-2.3.19.jar</systemPath>
                </dependency>第二步:把freemarker-null-2.3.19.jar放到项目src/main/webapp/WEB-INF/lib目录下
页: [1]
查看完整版本: 代码生成器生成一对多代码,无法生成主表的jsp页面