一 问题描述
用户反馈无法前台查询数据,报错500,后台查看日志如下,使用的是ibatis+oracle连接方式:
09:05:56 INFO -
atomikos connection proxy for [email protected]:
close()...
09:05:56 ERROR - 获取店内自己分类的列表数据发生异常~
--- The error
occurred while applying a parameter map.
--- Check the
SHOP.queryListByParentId-InlineParameterMap.
--- Check the
statement (query failed).
---
Cause: java.sql.SQLException: ORA-00904: "IS_DEFAULT": 标识符无效
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error
occurred while applying a parameter map.
--- Check the
SHO.queryListByParentId-InlineParameterMap.
--- Check the
statement (query failed).
---
Cause: java.sql.SQLException: ORA-00904: "IS_DEFAULT": 标识符无效
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)
at
com.supplier.service.impl.ShopServiceImpl.queryShopByParentId(ShopServiceImpl.java:119)
at
sun.reflect.GeneratedMethodAccessor395.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at
$Proxy61.queryShopByParentId(Unknown Source)
at
com.supplier.action.SupplierBaseAction.setShopForList(SupplierBaseAction.java:690)
at
com.supplier.action.product.ProductMainAction.showList(ProductMainAction.java:196)
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)
二 分析思路
1.检查sql.xml配置没有问题,字段和sql语句正常
2.检查jdbc.xml配置文件,查看数据库配置,登录对应数据库,检查表shop,发现shop下面确实没有此字段IS_DEFAULT
三 解决方法
添加shop下的这个字段即可(之前忘记添加了)
检查数据库:
SQL> desc shop
Name
Null? Type
-----------------------------------------
-------- ----------------------------
SHOP_ID NOT NULL
NUMBER(22)
MODIF_USER
NUMBER(22)
EXEC_SQL
VARCHAR2(250)
IS_EXPANDALL
VARCHAR2(2)
正常情况:
SQL> desc shop
Name
Null? Type
-----------------------------------------
-------- ----------------------------
SHOP_ID NOT NULL NUMBER(22)
MODIF_USER NUMBER(22)
EXEC_SQL VARCHAR2(250)
IS_EXPANDALL VARCHAR2(2)
IS_DEFAULT
VARCHAR2(2)