cancel
Showing results for 
Search instead for 
Did you mean: 

SAP JPA does not find MySQL tables

Former Member
0 Kudos

Hi,

I have a strange error on JPA that does not find MySQL tables on runtime. The project was ported from JBoss where the same is working. There we used eclipse link as JPA provider.

Exception is:

Caused by: com.sap.engine.lib.injection.InjectionException: Injection on field em of instance MyEntityClass@2f3cf0a9 failed. Could not get a value to be injected from the factory. 

em is the injection field for the EntityManager.

And a little later in stack:

Caused by: java.lang.RuntimeException: The persistence unit is inconsistent with the database schema:
Error on entity >>MyEntityClass<<: The table >>mydatabasetablename<< does not exist.
...

The entity looks as following:

@Entity
@Table(name = "mydatabasetablename", schema="myschema")
public class MyEntityClass implements Serializable {
...
}

The MySQL tables do exist and I can see them in NWDS with the user that is given in the datasource on the server (7.20 CE)

Anyone a hint what maybe wrong here?

Thanks,

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The answer was simple in the end.

I had to set the database mode to ANSI for MySql.