My application runs on Payara and provides a REST API but when I try to create an object with a POST request I get the following exception:
Exception [EclipseLink-43] (Eclipse Persistence Services - 2.6.0.payara-p1): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [Miss] of type [class java.lang.String].
Descriptor: XMLDescriptor(at.htl.handballinheritance.entity.Throw --> [DatabaseTable(event), DatabaseTable(dataObject)])
at org.eclipse.persistence.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:940)
at org.eclipse.persistence.internal.oxm.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:278)
...
On the contrary everything is fine and no errors occur when I am executing the program on Wildfly which uses Hibernate.
Entities:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@XmlRootElement
public abstract class Event extends DataObject implements Serializable {
...
}
@Entity
public class Throw extends Event implements Serializable {
@Enumerated(EnumType.STRING)
@NotNull
private ThrowingType type;
...
}
public enum ThrowingType {
Goal, Miss
}
REST API:
@POST
public Response create(Throw entity) {
em.persist(entity);
return Response.created(URI.create("...")).build();
}
I think that Eclipselink has problems to unmarshal my json. Do I need any additional annotation?