내 프로젝트에서 JaxB
오브젝트로 xml 파일을 생성했습니다. 이제 다시 언 마샬을 JAXB
개체로 지정합니다. unmarshalling 할 때 classcastException throw합니다.xml 파일을 비동기 해제 할 수 없습니다.
의 I가 작성한 클래스를 찾아주세요 :
public class ReservationTest1 {
public static void main(String []args) throws IOException, JAXBException
{
JAXBContext jaxbContext = JAXBContext.newInstance(com.hyatt.Jaxb.makeReservation.request.OTAHotelResRQ.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
@SuppressWarnings("unchecked")
JAXBElement bookingElement = (JAXBElement) unmarshaller.unmarshal(
new FileInputStream("D://myproject//Reservation.xml"));
System.out.println(bookingElement.getValue());
}
}
당신이 나에게 그것을 해결하기 위해 유용한 정보를 제공하시기 바랍니다 수 있습니다.