FreeMarker template error (HTML_DEBUG mode; use RETHROW in production!)
No error description was specified for this error; low-level message: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by publish_date desc) ORDER BY sort_flag ASC LIMIT 20' at line 1
### The error may exist in com/chestnut/cms/image/mapper/CmsImageMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT image_id,content_id,site_id,title,description,file_name,path,image_type,file_size,width,height,redirect_url,hit_count,sort_flag,create_by,create_time,update_by,update_time,remark FROM cms_image WHERE (content_id = ? AND order by publish_date desc) ORDER BY sort_flag ASC LIMIT ?
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by publish_date desc) ORDER BY sort_flag ASC LIMIT 20' at line 1
; bad SQL grammar []
----
FTL stack trace ("~" means nesting-related):
- Failed at: @cms_image contentid="${Content.conte... [in template "fcgzy_ALL/template/detail_img.template.html" at line 129, column 65]
----
Java stack trace (for programmers):
----
freemarker.template.TemplateException: [... Exception message was already printed; see it above ...]
at com.chestnut.common.staticize.tag.AbstractListTag.execute0(AbstractListTag.java:68)
at com.chestnut.common.staticize.tag.AbstractTag.execute(AbstractTag.java:64)
at freemarker.core.Environment.visit(Environment.java:452)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:102)
at freemarker.core.Environment.visit(Environment.java:335)
at freemarker.core.Environment.visit(Environment.java:341)
at freemarker.core.Environment.process(Environment.java:314)
at com.chestnut.common.staticize.StaticizeService.process(StaticizeService.java:93)
at com.chestnut.contentcore.publish.staticize.ContentStaticizeType.doContentStaticize(ContentStaticizeType.java:129)
at com.chestnut.contentcore.publish.staticize.ContentStaticizeType.contentStaticize(ContentStaticizeType.java:89)
at com.chestnut.contentcore.publish.staticize.ContentStaticizeType.staticize(ContentStaticizeType.java:80)
at com.chestnut.contentcore.publish.strategies.ThreadPoolPublishStrategy.lambda$publish$0(ThreadPoolPublishStrategy.java:59)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by publish_date desc) ORDER BY sort_flag ASC LIMIT 20' at line 1
### The error may exist in com/chestnut/cms/image/mapper/CmsImageMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT image_id,content_id,site_id,title,description,file_name,path,image_type,file_size,width,height,redirect_url,hit_count,sort_flag,create_by,create_time,update_by,update_time,remark FROM cms_image WHERE (content_id = ? AND order by publish_date desc) ORDER BY sort_flag ASC LIMIT ?
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by publish_date desc) ORDER BY sort_flag ASC LIMIT 20' at line 1
; bad SQL grammar []
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:246)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
at jdk.proxy2/jdk.proxy2.$Proxy134.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:164)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at jdk.proxy2/jdk.proxy2.$Proxy179.selectList(Unknown Source)
at com.baomidou.mybatisplus.core.mapper.BaseMapper.selectPage(BaseMapper.java:348)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$DefaultMethodInvoker.invoke(MybatisMapperProxy.java:166)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at jdk.proxy2/jdk.proxy2.$Proxy179.selectPage(Unknown Source)
at com.baomidou.mybatisplus.extension.service.IService.page(IService.java:448)
at jdk.internal.reflect.GeneratedMethodAccessor504.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:699)
at com.chestnut.cms.image.dao.CmsImageDAO$$SpringCGLIB$$0.page(<generated>)
at com.chestnut.cms.image.template.tag.CmsImageTag.prepareData(CmsImageTag.java:78)
at com.chestnut.common.staticize.tag.AbstractListTag.execute0(AbstractListTag.java:66)
... 14 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by publish_date desc) ORDER BY sort_flag ASC LIMIT 20' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:912)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at jdk.internal.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58)
at jdk.proxy3/jdk.proxy3.$Proxy249.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80)
at jdk.internal.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
at jdk.proxy2/jdk.proxy2.$Proxy247.query(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59)
at jdk.proxy2/jdk.proxy2.$Proxy246.query(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425)
... 35 more