问题描述:

I'm trying to unmarshal a JSON to a Java Object with JAXB but I got this error :

 [Exception [EclipseLink-43] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DescriptorException

Exception Description: Missing class for indicator field value [SUPP] of type [class java.lang.String].

Descriptor: XMLDescriptor(com.travelsoft.cameleo.bookingprocess.data.ElementJson --> [])]

at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:191)

at com.travelsoft.cameleo.bookingprocess.refactoring.action.process.SearchAvailabilityAndQuotationAction.execute(SearchAvailabilityAndQuotationAction.java:551)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)

at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)

at com.travelsoft.cameleo.bookingprocess.refactoring.interceptor.ExternalInterceptor.intercept(ExternalInterceptor.java:62)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)

at org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)

at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)

The class' attributes look like this and the one which doesn't work is "originalType" :

 private final static long serialVersionUID = 1L;

protected StatusJson status;

protected PriceJson priceValue;

protected PriceJson priceRule;

@XmlElement(name = "element")

protected List<ElementJson> elements;

protected PropertyJson property;

@XmlElement(name = "travellerRef")

protected List<TravellerRefJson> travellerReves;

protected PriceJson nettCosts;

protected InformationObjectJson informationObject;

@XmlAttribute

protected ElementSubTypeDefJson subType;

@XmlAttribute

protected String originalType;

@XmlAttribute

protected String groupRef;

Does anybody of you have an idea to solve this problem ?

Thanks !

EDIT : Here is the JSON I'm trying to unmarshal :

{

"serviceJson": {

"mandatoryService": {

"element": [

{

"descriptions": {

"description": [

{

"label": "CARBURANT J DEPART",

"providerType": "to"

}

]

},

"element": [],

"id": "TSE1",

"priceRule": {

"priceDetail": [

{

"amount": -14.0,

"descriptions": {

"description": [

{

"label": "CARBURANT J DEPART",

"providerType": "to"

}

]

},

"originalType": "SUPP",

"quantity": 2

}

]

},

"property": {

"processScope": "application",

"quantity": 1

},

"provider": {

"sourceCode": "FRAM"

},

"transient": false,

"travellerRef": [],

"type": "SUPP"

}

],

"priceValue": {

"amount": 0.0,

"priceDetail": []

}

},

"optionalService": {

"element": []

}

}

}

相关阅读:
Top