I try to connect OM2M with MySQL using JDBC by setting config.ini file. Some parameters are:
org.eclipse.om2m.dbUser=___
org.eclipse.om2m.dbDriver=com.mysql.jdbc.Driver
org.eclipse.om2m.dbPassword=____
When I check the DB in MySQL, all tables are created but no data. The IN and MN had an error regarding SQL syntax.
exception in thread "pool-1-thread-1" javax.persistence.RollbackException: Exception [EclipseLink-4002]
(Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax
to use near 'CREATE, DELETE, DISCOVERY, NOTIFY, RETRIEVE, UPDATE) VALUES (3, 1, 1, 1, 1, 1, 1' at line 1
Error Code: 1064
Call: INSERT INTO ACR (ACR_ID, CREATE, DELETE, DISCOVERY, NOTIFY, RETRIEVE, UPDATE) VALUES (?, ?, ?, ?, ?, ?, ?)
bind => [7 parameters bound]
Query: InsertObjectQuery(org.eclipse.om2m.commons.entities.AccessControlRuleEntity@65b108fc)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:157)
at org.eclipse.om2m.persistence.eclipselink.internal.DBTransactionJPAImpl.commit(DBTransactionJPAImpl.java:45)
at org.eclipse.om2m.core.CSEInitializer.initACP(CSEInitializer.java:370)
at org.eclipse.om2m.core.CSEInitializer.init(CSEInitializer.java:92)
at org.eclipse.om2m.core.Activator$2$1.run(Activator.java:106)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: You have an error in your
Then, I try to log the out-put of eclipselink-dll and find the invalid line is:
CREATE TABLE ACR (ACR_ID BIGINT NOT NULL, CREATE BOOLEAN, DELETE BOOLEAN, DISCOVERY BOOLEAN, NOTIFY BOOLEAN, RETRIEVE BOOLEAN, UPDATE BOOLEAN, PRIMARY KEY (ACR_ID))
Could you tell me how to fix this problem ?
Many thanks.