有人见过这样的错么?

njnu_zhoubo 2008-09-20 04:52:02

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause

java.lang.StackOverflowError
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)
com.xmart.hr.admin.model.entity.Promotion.setEmpId(Promotion.java:33)


promotion 是我写的一个bean,里面还有其他一些get,set函数,当我想把数据通过bean传到jsp上显示的时候,就出现这样的错误,当我在把程序中的setEmpid()注释掉,其他的值能正确显示,很怪异。
...全文
81 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
YOYOOOP 2008-09-22
  • 打赏
  • 举报
回复
我觉得楼上的正解
阿甘1976 2008-09-22
  • 打赏
  • 举报
回复
public void setEmpId(int empId) {
this.setEmpId(empId);
}
改为:
public void setEmpId(int empId) {
this.empId = empId;
}
njnu_zhoubo 2008-09-22
  • 打赏
  • 举报
回复
package com.xmart.hr.admin.model.entity;

import org.apache.struts.action.ActionForm;
/**
*
* @author BZ70000910
*/
public class Promotion extends ActionForm {
private int empId;
private String empName;
private String currentDept;
private String currentDesignation;
private String promotedDept;
private String promotedDesignation;
/** Creates a new instance of Promotion */
public Promotion() {
}

public int getEmpId() {
return empId;
}

public void setEmpId(int empId) {
this.setEmpId(empId);
}

public String getEmpName() {
return empName;
}

public void setEmpName(String empName) {
this.empName = empName;
}

public String getCurrentDept() {
return currentDept;
}

public void setCurrentDept(String currentDept) {
this.currentDept = currentDept;
}

public String getCurrentDesignation() {
return currentDesignation;
}

public void setCurrentDesignation(String currentDesignation) {
this.currentDesignation = currentDesignation;
}

public String getPromotedDept() {
return promotedDept;
}

public void setPromotedDept(String promotedDept) {
this.promotedDept = promotedDept;
}

public String getPromotedDesignation() {
return promotedDesignation;
}

public void setPromotedDesignation(String promotedDesignation) {
this.promotedDesignation = promotedDesignation;
}



}
njnu_zhoubo 2008-09-22
  • 打赏
  • 举报
回复
呵呵 ,一语提醒梦中人啊
阎罗 2008-09-20
  • 打赏
  • 举报
回复
把你的实体bean帖出来看看
vkqiang 2008-09-20
  • 打赏
  • 举报
回复
setEmpid()方法内有错误
wufongming 2008-09-20
  • 打赏
  • 举报
回复
StackOverflowError

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧