2013-07-20 50 views
0

我在glassfish4中部署EAR(第8章 - EJB 3的實例)時遇到了belo錯誤。我沒有發現這個錯誤。請幫我解決這個錯誤。EclipseLink期望在堆棧中查找對象/數組

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; 
    } 
} 
+1

我懷疑是錯誤的事實,你的'billingId'場'long',而不是'Long'型引起的。 –

+0

謝謝@JBNizet。解決了這個問題。 –

+0

發佈答案將其標記爲已回答。 –

回答

1

錯誤是由事實,你billingIdlong而不是Long型引起的。