0
캐스터 마샬에 XML로 내 객체를 시도했습니다 supprted하고 "앞으로 참조는 지원되지 않습니다"되었다는 오류가 발생했습니다되지 않습니다 나는 3 개 자바 클래스캐스터 오류 : 앞으로의 참조를
public class RandomTransactionRequest extends TransactionRequest {
public RandomTransactionRequest() { super("location") }
}
public class TransactionRequest extends ServiceRequest {
private StatusObject status;
public TransactionRequest (String destination) {
setDestination(destination);
}
}
public class ServiceRequest {
private String destination;
public String getDestination(){ return destination; }
public void setDestination(String destination) { this.destination = destination; }
}
내가 XML을 기다리고 있었다 있었다 그 모습 다음 :
<?xml version="1.0" encoding="UTF-8"?>
<mapping>
<class name="com.package.requests.RandomTransactionRequest" extends="com.package.requests.TransactionRequest">
<map-to xml="REQUEST"/>
</class>
<class name="com.package.requests.TransactionRequest" extends="com.package.requests.ServiceRequest">
<field name="status" type="com.package.objects.StatusObject">
<bind-xml name="STATUS" location="APP"/>
</field>
</class>
<class name="com.package.requests.ServiceRequest" >
<field name="destination" type="java.lang.String">
<bind-xml name="DEST" />
</field>
</class>
<class name="com.package.objects.StatusObject" >
<field name="initialStatus" type="java.lang.String">
<bind-xml name="INIT_STAT"/>
</field>
<field name="finalStatus" type="java.lang.String">
<bind-xml name="FIN_STAT"/>
</field>
</class>
</mapping>
: 클래스 A에 대한
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<REQUEST>
<DEST>location</DEST>
<STATUS_FIELDS>
<STATUS>
<INIT_STAT>incomplete</INIT_STAT>
<FIN_STAT>complete</FIN_STAT>
</STATUS>
</STATUS_FIELDS>
</REQUEST>
내 캐스터 매핑은 다음처럼 보였다
수신 오류 :
나는 TransactionRequest에 기본 생성자가 추가되었다 무엇No class descriptor found for extended class [email protected] in class com.package.requests.RandomTransactionRequest -- forward references are not supported