0

I'm getting the following error when I try to use JPA to persist a field entity into the database saying the variable must be serialized. The tricky part is that, I have the same variable name in a different Entity class. Are they overlaping?

Exception Description: Predeployment of PersistenceUnit [xa_datasource] failed.
Internal Exception: Exception [EclipseLink-7155] (Eclipse Persistence Services - 2.6.5.WAS-v20171031-22b68cc): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class java.lang.Object] for the attribute [expiration] on the entity class [class model.Ard] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.

Entity

@Entity
@Table(name = "ARD", schema = "REF_OWN")
public class Ard implements Serializable {
  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "EVENT")
  private String eventC;
  .....
 @Column(name = "EXPIRATION")
  private Object expiration;

My other entity class...

@Entity
@Table(name = "ARD_STATE", schema = "REF_OWN")
@NamedQuery(name = "ArdStateAttribute.findAll", query = "SELECT a FROM ArdStateAttribute a")
public class ArdStateAttribute implements Serializable {

  private static final long serialVersionUID = 12344567;

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "STATE_ATTRIBUTE")
  private String stateAttributeC;
  .....
  @Column(name = "EXPIRATION")
  private Object expiration;
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
cubila
  • 43
  • 2
  • 8
  • Please show the entirety of 'Ard', specifically, the instance variable called 'type'. Your error message specifically says that there is something wrong with class Ard, attribute type. – Jeff Bennett Nov 30 '22 at 16:34

0 Answers0