hjl306799975 发表于 2015-3-14 18:58:23

jeecg3.5 代码生成出现错误

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression packageStyle is undefined on line 1, column 6 in cgform_serviceImplTemplate.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:121)
        at freemarker.core.IfBlock.accept(IfBlock.java:80)
        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.generate.CgformCodeFactory.generateFile(CgformCodeFactory.java:79)
        at org.jeecgframework.codegenerate.generate.CgformCodeFactory.invoke(CgformCodeFactory.java:194)
        at org.jeecgframework.codegenerate.generate.CgformCodeGenerate.generateToFile(CgformCodeGenerate.java:217)
        at org.jeecgframework.web.cgform.controller.generate.GenerateController.dogenerate(GenerateController.java:168)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
        at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)


请问怎么解决?

admin 发表于 2015-3-18 09:33:17

这个是怎么操作的?

hjl306799975 发表于 2015-3-18 13:32:42

是在这里出现的,我下的是JEECG3.5.0 + MyEclipse2014 + SQL2008版本,用maven版的没这问题

king-h 发表于 2015-3-21 17:10:48

遇到同样的问题。。。:(:(

king-h 发表于 2015-3-21 17:17:07

跟踪了一下,类GenerateController中,line 162行generateEntity的packageStyle属性是有值的。是不是jar文件:codegenerate-3.4.4_02需要更新呢?packageStyle貌似是3.5版本新加的

hjl306799975 发表于 2015-3-23 17:06:17

http://www.jeecg.org/forum.php?m ... 2360&extra=page%3D1
下载最新lib替换上去就ok了
页: [1]
查看完整版本: jeecg3.5 代码生成出现错误