Jaxb - com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 8 counts of IllegalAnnotationExcepti

襲冷發表於2018-08-08

一、異常

com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 8 counts of IllegalAnnotationExceptions
類的兩個屬性具有相同名稱 "orderName"
	his problem is related to the following location:
		at public java.lang.String com.xl.mall.entity.Order.getOrderName()
		at com.xl.mall.entity.Order
	this problem is related to the following location:
		at private java.lang.String com.xl.mall.entity.Order.orderName
		at com.xl.mall.entity.Order

二、方案

    實體類中的屬性和Getter方法衝突,在class上註解@XmlAccessorType(XmlAccessType.FIELD)即可

 

 

相關文章