錯(cuò)誤(并不是int非包裝類型之類的問(wèn)題):HTTP Status 500 - exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.qst.giftems.gift.pojos.TGift.setTypeId; nested exception is org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.qst.giftems.gift.pojos.TGift.setTypeIdTGift.javapackage com.qst.giftems.gift.pojos;public class TGift { private Integer id; private Integer typeId; private Integer sales; private String pic; private TGiftType type; /** 款式集合 **/ private List<TGiftStyle> styles = new ArrayList<TGiftStyle>(); //用戶集合 private Set<TUser> users = new HashSet<TUser>(); public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getTypeId() { return typeId; } public void setTypeId(Integer typeId) { this.typeId = typeId; } public Integer getSales() { return sales; } public void setSales(Integer sales) { this.sales = sales; } public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic; } public TGiftType getType() { return type; } public void setType(TGiftType type) { this.type = type; } public List<TGiftStyle> getStyles() { return styles; } public void setStyles(List<TGiftStyle> styles) { this.styles = styles; } public Set<TUser> getUsers() { return users; } public void setUsers(Set<TUser> users) { this.users = users; }}TGift.hbm.xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD?3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!--?? ?Mapping file autogenerated by MyEclipse Persistence Tools--> <!-- ?dynamic-insert="true" dynamic-update="true" --> <hibernate-mapping> ? ?<class name="com.qst.giftems.gift.pojos.TGift" table="t_gift"?catalog="gift_ems" lazy="false" >? ? ? ? ?<id name="id" type="java.lang.Integer"> ? ? ? ? ? ?<column name="id" /> ? ? ? ? ? ?<generator class="native" /> ? ? ? ?</id> ? ? ? ?<many-to-one name="typeId"?class="com.qst.giftems.gift.pojos.TGiftType" fetch="select"> ? ? ? ? ? ?<column name="type_id" not-null="false"> ? ? ? ? ? ? ? ?<comment>類型ID</comment> ? ? ? ? ? ?</column> ? ? ? ?</many-to-one> ? ? ? ?<property name="sales" type="java.lang.Integer"> ? ? ? ? ? ?<column name="sales"> ? ? ? ? ? ? ? ?<comment>該商品銷售數(shù)量 </comment> ? ? ? ? ? ?</column> ? ? ? ?</property> ? ? ? ?<property name="pic" type="java.lang.String"> ? ? ? ? ? ?<column name="pic" /> ? ? ? ?</property> ? ? ? ?<!-- 配置與TUser的多對(duì)多關(guān)聯(lián)關(guān)系 --> ? ? ? ?<set name="users" table="t_user_cart"> ? ? ? ? ? ?<key> ? ? ? ? ? ? ? ?<column name="gift_id" > ? ? ? ? ? ? ? ? ? ?<comment>禮品ID</comment> ? ? ? ? ? ? ? ?</column> ? ? ? ? ? ?</key> ? ? ? ? ? ?<many-to-many class="com.qst.giftems.user.pojos.TUser"?column="user_id"/> ? ? ? ?</set> ? ? ? ?<set name="styles" inverse="true"> ? ? ? ? ? ?<key> ? ? ? ? ? ? ? ?<column name="gift_id" not-null="true"> ? ? ? ? ? ? ? ? ? ?<comment>禮品ID</comment> ? ? ? ? ? ? ? ?</column> ? ? ? ? ? ?</key> ? ? ? ? ? ?<one-to-many class="com.qst.giftems.gift.pojos.TGiftStyle" /> ? ? ? ?</set>? ? ?</class> </hibernate-mapping>
SSH三大框架整合項(xiàng)目中的錯(cuò)誤
qq_綠川夏_03247384
2016-11-09 13:24:35