Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Connect OM2M with MySQL(Error SQL syntax)
Connect OM2M with MySQL [message #1827984] Thu, 28 May 2020 10:09
hieu tran is currently offline hieu tranFriend
Messages: 19
Registered: November 2017
Junior Member
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.
Previous Topic:error in running OM2M
Next Topic:OM2M - API documentation
Goto Forum:
  


Current Time: Sat Jun 03 18:22:24 GMT 2023

Powered by FUDForum. Page generated in 0.01919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top