首页 > 代码库 > java.lang.ArrayIndexOutOfBoundsException: 17
java.lang.ArrayIndexOutOfBoundsException: 17
项目框架 SpringMVC+Hibernate
开发工具 Myeclipse10
报错代码(下图):
检查项目发现出现问题的原因:配置文件有问题,少配置了一个字段,下面红色注释部分。
<fields>
a.id,a.title,a.author,a.content,a.source,a.createDate,a.releaseDate,(select name from BDic b where b.id=a.audit),(select name from BDic b where b.id=a.release),a.status,(select name from BDic b where b.id=a.type),b.id,c.id,d.id,a.newType,a.contentPicture,a.targetUrl,a.kind
</fields>
配置上缺少的字段,再次运行OK。
以下为部分完整代码段:
<query> <id>getList</id> <method>getList</method> <params> <param name="condition" type="java.util.Map"></param> <param name="sort" type="java.lang.String"></param> </params> <properties>id,title,author,content,source,createDate,releaseDate,audit,release,status,type,topic.id,channel.id,conference.id,newType,contentPicture,targetUrl,kind </properties> <fields>a.id,a.title,a.author,a.content,a.source,a.createDate,a.releaseDate,(select name from BDic b where b.id=a.audit),(select name from BDic b where b.id=a.release),a.status,(select name from BDic b where b.id=a.type),b.id,c.id,d.id,a.newType,a.contentPicture,a.targetUrl,a.kind </fields> <hql>from News a left join a.topic b left join a.channel c left join a.conference d </hql> <conditions> <condition id="id" describe="id"> <params type="param"> <param name="id" type="java.lang.String"></param> </params> <hql>a.id = ?</hql> </condition> <condition id="title" describe=""> <params type="param"> <param name="title" type="java.lang.String" /> </params> <hql>a.title like ?</hql> </condition> <condition id="author" describe=""> <params type="param"> <param name="author" type="java.lang.String" /> </params> <hql>a.author like ? </hql> </condition> <condition id="source" describe=""> <params type="param"> <param name="source" type="java.lang.String" /> </params> <hql>a.source like ? </hql> </condition> <condition id="audit" describe=""> <params type="param"> <param name="audit" type="java.lang.String" /> </params> <hql>a.audit like ? </hql> </condition> </conditions> <group></group> <order></order> <className>cn.digitalpublishing.po.News</className> </query>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。