gpt4 book ai didi

java - EclipseLink 期望在堆栈上找到对象/数组

转载 作者:行者123 更新时间:2023-12-01 14:19:19 24 4
gpt4 key购买 nike

在 glassfish4 中部署 EAR(第 8 章的示例 - EJB 3 实际操作)时,我收到 belo 错误。我没有发现任何关于这个错误的信息。请帮我解决这个错误。

SEVERE: Exception while deploying the app [chapter8-ear] : Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [actionBazaar] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.VerifyError: (class: actionbazaar/persistence/BillingInfo, method: setBillingId signature: (Ljava/lang/Long;)V) Expecting to find object/array on stack

这是 BillingInfo 类定义。

@Entity
@Table(name = "BILLING_DETAILS")
public class BillingInfo implements java.io.Serializable {

protected long billingId;

protected String accountNumber;

protected String expiryDate;

protected String secretCode;

protected Address address;


public BillingInfo() {
}


@SequenceGenerator(name = "BILLING_SEQ_GEN", sequenceName = "BILLING_SEQUENCE", initialValue = 1, allocationSize = 1)
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "BILLING_SEQ_GEN")
@Column(name = "BILLING_ID")
public Long getBillingId() {
return this.billingId;
}


@Column(name = "ACCOUNT_NO")
public String getAccountNumber() {
return accountNumber;
}


@Column(name = "EXPIRY_DATE")
public String getExpiryDate() {
return expiryDate;
}


@Column(name = "SECRET_CODE")
public String getSecretCode() {
return secretCode;
}


@Embedded
@AttributeOverrides( {
@AttributeOverride(name = "state", column = @Column(name = "STATE_CD")),
@AttributeOverride(name = "zipCode", column = @Column(name = "ZIP_CD")) })
public Address getAddress() {
return address;
}


public void setBillingId(Long billingId) {
this.billingId = billingId;
}


public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}


public void setExpiryDate(String expiryDate) {
this.expiryDate = expiryDate;
}


public void setSecretCode(String secretCode) {
this.secretCode = secretCode;
}


public void setAddress(Address address) {
this.address = address;
}
}

最佳答案

该错误是由于您的 billingId 字段的类型为 long 而不是 Long 导致的。

关于java - EclipseLink 期望在堆栈上找到对象/数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17763897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com