Invocation of init method failed could not instantiate test object
来源:互联网 发布:ubuntu不能切换输入法 编辑:程序博客网 时间:2024/05/17 10:56
Invocation of init method failed; nested exception is
org.hibernate.InstantiationException: could not instantiate test object com.yjiasoft.table.StationInfo
这里做的是双向关联
错误实体类:
public class StationInfo implements java.io.Serializable {
// Fields
private Integer id;
private String stationName;
private String code;
private String linkman;
private String comTel;
private String cellPhone;
private Integer levelFlag;
private Integer qualityFlag;
private Integer speedFlag;
private String remark;
private Integer groupId;
private String areaAxis;
private Integer ztxtLeft;
private Integer ztxtTop;
private River river = new River();
//getter
//setter
}
public class River implements java.io.Serializable {
// Fields
private Integer id;
//private Integer stcdt;
private String name;
private double lower;
private double high;
private double minflux;
private double maxflux;
private StationInfo station =new StationInfo();
//getter
//setter
}
解决方法:定义结构会导致死循环,结果堆栈溢出,所以 在定义时两个成员类不要实例化,可初始
化为null。
改成如下:
public class StationInfo implements java.io.Serializable {
// Fields
private Integer id;
///.....////
private Integer ztxtTop;
private River river ;
//getter
//setter
}
public class River implements java.io.Serializable {
// Fields
private Integer id;
///.....////
private double maxflux;
private StationInfo station;
//getter
//setter
}
- Invocation of init method failed could not instantiate test object
- Invocation of init method failed; Could not get a resource from the pool
- Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [
- 【Java 6】Invocation of init method failed
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a mana
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError
- Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/
- Invocation of init method failed; nested exception is org.hibernate.PropertyAccessException: Illegal
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFa
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
- Invocation of init method failed; nested exception is javax.naming.CommunicationException [Root exce
- CXF2.7.0 Error creating bean with name '***': Invocation of init method failed; nested exception is
- Invocation of init method failed; nested exception is org.apache.ibatis.binding.BindingException: In
- Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path reso
- Invocation of init method failed; nested exception is java.lang.NoSuchMethod
- 关于mindmanager2012的使用
- 网易公开课:
- C# & WinForm 开发Windows7多点触控(Multi-Touch)应用程序
- MFC内部运行来龙去脉追踪
- OpenGL学习笔记(四)---画动态圆
- Invocation of init method failed could not instantiate test object
- 二叉树的非递归遍历
- 编译并使用boost库(win7+boost1.53+vs2012)
- JSP中循环时用到的代码
- Swift与Keystone认证问题,Permission denied: '/root/keystone-signing'
- QT自带QTcpServer架构分析
- 获取货币汇率API
- rank()随机函数的使用
- 第4章 商业蜂窝通信系统的典范-GSM