### Cause: java.lang.reflect.UndeclaredThrowableException

Posted TieNiuabilty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了### Cause: java.lang.reflect.UndeclaredThrowableException相关的知识,希望对你有一定的参考价值。

### Cause: java.lang.reflect.UndeclaredThrowableException

 

Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database. Cause: java.lang.reflect.UndeclaredThrowableException
### The error may exist in file [E:codeBase	op713superrescue-service	argetclassesmybatisqcTechserviceEffiserviceEntityMapper.xml]
### The error may involve com.jn.ssr.superrescue.web.serviceEffi.dao.TechserviceEffiserviceEntityMapper.findTechEffi
### The error occurred while executing a query

 

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "(" "( "" at line 2, column 8.
Was expecting one of:
<EOF> 
"AS" ...
"DO" ...
"ANY" ...
"KEY" ...
"PERCENT" ...
"END" ...

 

mybatis的错误,将sql放在Navicat中执行都可以

然后在<select></select>中写一个简单sql,发起情求,sql可以执行,说明mapper映射与resultMap还有parmaterType等没有错误

将sql的字段一个一个的字段进行删除然后执行,判断是哪个字段出错,最后找出是

SUM(o.service_type!=TC) AS repair_number,

 

这个字段,仿佛是mybatis不支持 SUM(列名)的格式

最后将这个字段修改为:

  (select count(service_type) from or_rescue_order oro where service_type!="TC" and o.id = oro.id) AS repair_number,

 

就可以了

以上是关于### Cause: java.lang.reflect.UndeclaredThrowableException的主要内容,如果未能解决你的问题,请参考以下文章

java反射--获取成员变量信息

异常类Exception(String message, Throwable cause)中的cause理解

Cause: java.sql.SQLException: Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNot

关于Json在SSh框架中出现的问题

### Cause: java.lang.reflect.UndeclaredThrowableException

mysql报错:Cause: com.mysql.jdbc.PacketTooBigException