weixin_42306359 2009-04-16 14:06
浏览 501
已采纳

Error -26612 HTTP Status-Code=500

cliamcase.c(473) Continuing after Error -26612 HTTP Status-Code=500 (Internal Server Error) for "http//192.168.90.250/crm/insure/hscrm/business/icc/claimcase/claimCaseAction.do?act=onQueryClaimCaseList&clientName=&_currentMenuId=12101"

服务器为一个apache + 两个tamcat的形式,LoaderRunner测试时模拟50用户时偶尔包如上错误,后面ur为点击菜单事件,点击菜单后查询列表

不知哪位高手有知道
[b]问题补充:[/b]
[size=large][color=red]确实claimCaseAction.do中报java.sql.SQLException,但是为什么一样的查询为什么测了很多次都正常只是有时候会报错呢[/color][/size]
[b]问题补充:[/b]
[size=large][color=darkblue]看来huangnetian 的回答感觉可能是分页查询的方法写的有问题,查询数据的DAO是集成自CommonDAO.java的,以实现分页功能,附近为CommonDAO.java ,请帮忙看一下 感激不尽[/color][/size]
[b]问题补充:[/b]
[color=red]各位先谢过,以下为异常和CommonDAO.java
java.sql.SQLException
at com.zhangsheng.hscrm.framework.common.base.CommonDAO.queryForPage(CommonDAO.java:109)
[/color]
[code="java"]
package com.zhangsheng.hscrm.framework.common.base;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.hsipcc.system.PageInfo;
import com.ibatis.sqlmap.client.SqlMapClient;

public class CommonDAO {

protected SqlMapClient sqlMapClient = DAOConfig.getSqlMapInstance();

public static String doCount = "yes"; //标识当前操作是否计算记录总数

private static Logger logger = Logger.getLogger(CommonDAO.class);

/**
 * 统计记录条数
 * 
 * @param id               -- SQLId
 * @param parameterObject  --查询参数
 * @return                 --统计结果
 * @throws SQLException
 */
public int count(String id, BaseEntity parameterObject) throws SQLException {
    BaseEntity count = new BaseEntity();
    int countNum;
    try {
        parameterObject.setDoCount(doCount);

        count = (BaseEntity) sqlMapClient.queryForObject(id,
                parameterObject);

        countNum = Integer.parseInt(count.getSqlCountNum());
    } catch (Exception e) {
        e.printStackTrace();
        throw new SQLException();

    }
    return countNum;
}

/**
 * 分页查询
 * 
 * @param id              --  SQLid
 * @param parameterObject -- 条件参数
 * @param pageInfo        -- 分页信息
 * @return                --分页的记录集
 * @throws SQLException
 * 修改历史:
 *   1、修改翻页逻辑 modified by  tangyh  2008-4-10  
 *      
 */
@SuppressWarnings("unchecked")
public List queryForPage(String id, BaseEntity parameterObject,
        PageInfo pageInfo) throws SQLException {
    List pageList;

    if (pageInfo == null) {
        pageInfo = new PageInfo();
    }
    //每页显示的记录数(默认为20条)
    if (pageInfo.getPageLines() == 0) {
        pageInfo.setPageLines(20);
    }
    try {
        //计算总记录数
        int countResult = count(id , parameterObject);
        //计算总页数
        int pages=(countResult + pageInfo.getPageLines() - 1)/ pageInfo.getPageLines();
        //当前页码
        int curPage=pageInfo.getCurrentPage();
        if (curPage < 1) curPage=1;
        if(curPage > pages ) curPage=pages;

        parameterObject.clears();

        //总记录数
        pageInfo.setTotalRows(countResult);
        //总页数
        pageInfo.setTotalPages(pages);
        //当前页码
        pageInfo.setCurrentPage(curPage);
        int beginRows = (pageInfo.getCurrentPage()-1) * pageInfo.getPageLines();

        pageList = sqlMapClient.queryForList(id, parameterObject, beginRows, pageInfo.getPageLines());
    } catch (Exception e) {
        e.printStackTrace();
        throw new SQLException();
    }
    return pageList;
}

/**
 * @param userId
 * @return 根据用户Id返回其上司列表
 * @throws SQLException
 */
public List<String> getUpperUser(String userId) throws SQLException{
    String upper = (String)sqlMapClient.queryForObject("queryUppers",userId);
    if (upper == null){
        upper = "";
    }
    String uppers[] = upper.split(",");
    List<String> retList = new ArrayList<String>();
    if (uppers != null && uppers .length != 0 && !"".equals(uppers[0])){
        for (String s:uppers){
            retList.add(s);
        }
    }
    return retList;
}

/**
 * @param userId
 * @return 根据用户Id返回其Name
 * @throws SQLException
 */
public String getUserName(String userId) throws SQLException{
    Object obj = sqlMapClient.queryForObject("queryUserName",userId);
    String name = "";
    if (obj != null) {
        name = (String) obj;
    }
    return name;
}

/**查询制定序列的序列值:
 * 注意:此方法只用于Oracle
 * @param sequencesName 序列名称
 * @return 序列值
 * @throws SQLException
 * @throws NumberFormatException
 */
public int getSequences(String sequencesName) throws SQLException{
    String retVal = "";
    int ret = 0;
    try {
        retVal = (String)sqlMapClient.queryForObject("getSequences",sequencesName);

        ret = Integer.valueOf(retVal);
    } catch (NumberFormatException e) {
        logger.error("数据转换异常!");
    } catch (SQLException e) {
        logger.error("获取序列值时,数据库异常:请检查序列"+sequencesName+"是否存在。", e);
        throw e;
    }
    return ret;
}

}

[/code]
[b]问题补充:[/b]
[color=darkred][size=x-large]不小心删了几行注释,109行应为[/size][/color]

[code="java"]

pageList = sqlMapClient.queryForList(id, parameterObject, beginRows, pageInfo.getPageLines());
    } catch (Exception e) {
        e.printStackTrace();
        [color=red]throw new SQLException();[/color]
    }

[/code]

中的throw new SQLException();

谢谢
[b]问题补充:[/b]
开发环境下没有保存不好调试啊 :cry:
[b]问题补充:[/b]
[size=large]谢谢lovewhzlq[/size]

[code="java"]
--- The error occurred while applying a result map.

--- Check the queryClaimBillPage-AutoResultMap.

--- The error happened while setting a property on the result object.

--- Cause: java.lang.RuntimeException: Error setting property 'setClaimNotificationNumber' of 'com.hundsun.hscrm.business.icc.claim.claimcase.entity.ClaimNotificationBill@1f71a09'. Cause: java.lang.ArrayIndexOutOfBoundsException: 1

[/code]

继续测试发现好像是由以上这个错误引起的,claimNotificationNumber属性对应数据库中“[color=red]01-47-09-116[/color]”这种类型的数据转换成entity时报错了,总共才3000条数据,为什么有时会报这个错误呢
[b]问题补充:[/b]
:D 没办法,就这点能力 也就搞搞山寨框架
[b]问题补充:[/b]
昨天的问题还没有解决,但是仍然感谢大家的问答。

当并发达到50左右的时候偶尔会报

The error happened while setting a property on the result object.

--- Cause: java.lang.RuntimeException: Error setting property 'setClaimNotificationNumber' of 'com.icc.claim.claimcase.entity.ClaimNotificationBill@1f71a09'. Cause: java.lang.ArrayIndexOutOfBoundsException: 1

开发环境上调试都正常,再三考虑后觉得可能由以下问题引起的:
sql中查询返回使用的是resultClass="ClaimNotificationBill"而非resultMap,造成性能下降,
没有配置记录集合的映射,没有映射,Ibatis就是瞎子。所有东西都用来反射,那么数据库持久层将是一个大的瓶颈,
程序运行到此处resultClass="ClaimNotificationBill",ClaimNotificationBill类有一百多个属性,invok时性能影响较大,所以经常在此处报错,

以上猜想,明天再去测下看看

  • 写回答

9条回答 默认 最新

  • wanghaolovezlq 2009-04-16 14:11
    关注

    Status-Code=500,这个错误就是代表是服务端的内部错误,基本是因为代码写得有问题,
    claimCaseAction.do这个action代码写得应该有问题

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(8条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!