ERROR 08 六月 2010 10:34:37 [org.springframework.web.context.ContextLoader] [initWebApplicationContext] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for collectingType in class com.baidu.manageSystem.machineRoom.dto.CollectingManner
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for collectingType in class com.baidu.manageSystem.machineRoom.dto.CollectingManner
Could not find a getter for collectingType in class com.baidu.manageSystem.machineRoom.dto.CollectingManner
getXx()方法写错了吧
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for collectingType in class com.baidu.manageSystem.machineRoom.dto.CollectingManner启动tomcat时报错
return this.collectingType;
} public void setCollectingType(CollectingType collectingType) {
this.collectingType = collectingType;
}
collectingType 这个东西 在CollectingManner这个action里没有 getter 方法
* CollectingManner entity. @author MyEclipse Persistence Tools
*/public class CollectingManner extends BaseDTO implements java.io.Serializable { // Fields /**
*
*/
private static final long serialVersionUID = 1L;
private CollectingMannerId id;
private String chname;
private String enname;
private Double colletingDay;
private Double Day; // Constructors /** default constructor */
public CollectingManner() {
} /** minimal constructor */
public CollectingManner(CollectingMannerId id, String chname, String enname) {
this.id = id;
this.chname = chname;
this.enname = enname;
} /** full constructor */
public CollectingManner(CollectingMannerId id, String chname,
String enname, Double colletingDay) {
this.id = id;
this.chname = chname;
this.enname = enname;
this.colletingDay = colletingDay;
} // Property accessors public CollectingMannerId getId() {
return this.id;
} public void setId(CollectingMannerId id) {
this.id = id;
} public String getChname() {
return this.chname;
} public void setChname(String chname) {
this.chname = chname;
} public String getEnname() {
return this.enname;
} public void setEnname(String enname) {
this.enname = enname;
} public Double getColletingDay() {
return this.colletingDay;
} public void setColletingDay(String colletingDay) {
this.colletingDay = Day;
}}
* CollectingMannerId entity. @author MyEclipse Persistence Tools
*/public class CollectingMannerId extends BaseDTO implements java.io.Serializable { // Fields private String id;
private CollectingType collectingType; // Constructors /** default constructor */
public CollectingMannerId() {
} /** full constructor */
public CollectingMannerId(String id, CollectingType collectingType) {
this.id = id;
this.collectingType = collectingType;
} // Property accessors public String getId() {
return this.id;
} public void setId(String id) {
this.id = id;
} public CollectingType getCollectingType() {
return this.collectingType;
} public void setCollectingType(CollectingType collectingType) {
this.collectingType = collectingType;
} public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof CollectingMannerId))
return false;
CollectingMannerId castOther = (CollectingMannerId) other; return ((this.getId() == castOther.getId()) || (this.getId() != null
&& castOther.getId() != null && this.getId().equals(
castOther.getId())))
&& ((this.getCollectingType() == castOther.getCollectingType()) || (this
.getCollectingType() != null
&& castOther.getCollectingType() != null && this
.getCollectingType().equals(
castOther.getCollectingType())));
} public int hashCode() {
int result = 17; result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
result = 37
* result
+ (getCollectingType() == null ? 0 : this.getCollectingType()
.hashCode());
return result;
}}联合主键自动生成的两个实体类,请高手指教,要不要对他们两个实体类都操作
Could not find a getter for collectingType in class com.baidu.manageSystem.machineRoom.dto.CollectingManner
public class CollectingManner extends BaseDTO implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private CollectingMannerId id;
private String chname;
private String enname;
private Double colletingDay;
private Double Day;
CollectingManner 是没有collectingType 的get set 啊, 楼主配置不对吧。
不应该把collectingType 配到CollectingManner 中的吧。SPRING 已经没用很久了。 但看错误 应该还是配置的不对。 或者说写的类和配置不对应。