I\'m setting up a standalone Java service with an in-process, in-memory HSQL database.
Persistence.xml
I ran into a similar problem, but in my case the problem occurred because of column definitions. I used MySQL definitions in this way:
@Id
@GeneratedValue
@Column(columnDefinition = "INT(11)")
private long id;
This seems to not be supported by HSQL, and I changed the definition to this:
@Id
@GeneratedValue
@Column(columnDefinition = "INTEGER")
private long id;
And then the tests worked again.
When I had this error, I realised that I was using the wrong provider class in persistence.xml
For Hibernate it should be
<provider>org.hibernate.ejb.HibernatePersistence</provider>
And for EclipseLink it should be
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
You should also note that different names are used in persistence.xml
and when creating Persistence.createEntityManagerFactory("name")