My question is with regards to error messages when i try to create or even view the credit package.
This is the error message that i encountered in glassfish.
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'ABOUT' in 'field list'
Error Code: 1054
Call: SELECT CREDITID, ABOUT, CREDITS, NAME, PACKAGECODE FROM CREDITPACKAGE
Query: ReadAllQuery(referenceClass=CreditPackage sql="SELECT CREDITID, ABOUT, CREDITS, NAME, PACKAGECODE FROM CREDITPACKAGE")
Error message from my own admin client
Caused by: javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446393 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException vmcid: OMG minor code: 57 completed: Maybe
at ejb.session.stateless._CreditPackageControllerRemote_Wrapper.retrieveAllCreditPackage(ejb/session/stateless/_CreditPackageControllerRemote_Wrapper.java)
The columns are accounted for, but i'm not sure why it says that unknown column 'ABOUT' in 'field list'
@Entity
public class CreditPackage implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long creditId;
@Column(unique = true)
private String packageCode;
@Column(length = 32, nullable = false)
private String name;
@Column(length = 32, nullable = false)
private String about; //already tried escaping the column name using `` and backslashes
@Column(nullable = false, precision = 18, scale = 4)
private BigDecimal credits;
}
This method is in the controller sessionbean
@Override
public List<CreditPackage> retrieveAllCreditPackage() {
Query query = em.createQuery("SELECT s FROM CreditPackage s"); //Not too sure if this is correct
return query.getResultList();
}
Thank you for reading this! Hopefully there is someone that can help me to resolve this.
Managed to resolve this question with others help. Turns out i did not regenerate the JDBC database when i added some new columns so the old columns are still there. Hence the exception.
So what i did was:
Then the error is resolved because it regenerates the new tables in JDBC database according to the new columns.
Hope that it will be helpful to others. Thank you for reading this. :)