Skip to Navigation

After install opentaps1.5 in windows,report the error as "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: .."

1 reply [Last post]
wuyutiange
User offline. Last seen 21 weeks 6 days ago. Offline
Joined: 12/20/2011

hi,guys
After install opentaps .5 in Win7 32(I thought I did everything, including to change the character set in the configuration file of opentaps) and did "startofbiz.bat", seems everything is ok, but go to http://localhost:8080/opentaps, got errors "httP error 500", then checked the cosole.log, found the message as below(BTW, I use Navicat as mysql GUI tools and set the database of opentaps attri. )

2011-12-21 23:52:29,476 (main) [ DatabaseUtil.java:345:WARN ] Entity [AccommodationClass] has no table in the database
2011-12-21 23:52:29,507 (main) [ DatabaseUtil.java:353:ERROR] Could not create table [ACCOMMODATION_CLASS]: SQL Exception while executing the following:
CREATE TABLE ACCOMMODATION_CLASS (ACCOMMODATION_CLASS_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, PARENT_CLASS_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci, DESCRIPTION VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci, LAST_UPDATED_STAMP DATETIME, LAST_UPDATED_TX_STAMP DATETIME, CREATED_STAMP DATETIME, CREATED_TX_STAMP DATETIME, CONSTRAINT PK_ACCOMMODATION_CLASS PRIMARY KEY (ACCOMMODATION_CLASS_ID)) TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1
2011-12-21 23:52:29,507 (main) [ DatabaseUtil.java:345:WARN ] Entity [AccommodationMap] has no table in the database
2011-12-21 23:52:29,601 (main) [ DatabaseUtil.java:353:ERROR] Could not create table [ACCOMMODATION_MAP]: SQL Exception while executing the following:
CREATE TABLE ACCOMMODATION_MAP (ACCOMMODATION_MAP_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, ACCOMMODATION_CLASS_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci, FIXED_ASSET_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci, ACCOMMODATION_MAP_TYPE_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci, NUMBER_OF_SPACES DECIMAL(20,0), LAST_UPDATED_STAMP DATETIME, LAST_UPDATED_TX_STAMP DATETIME, CREATED_STAMP DATETIME, CREATED_TX_STAMP DATETIME, CONSTRAINT PK_ACCOMMODATION_MAP PRIMARY KEY (ACCOMMODATION_MAP_ID)) TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1
2011-12-21 23:52:29,601 (main) [ DatabaseUtil.java:345:WARN ] Entity [AccommodationMapType] has no table in the database
2011-12-21 23:52:29,601 (main) [ DatabaseUtil.java:353:ERROR] Could not create table [ACCOMMODATION_MAP_TYPE]: SQL Exception while executing the following:
CREATE TABLE ACCOMMODATION_MAP_TYPE (ACCOMMODATION_MAP_TYPE_ID VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, DESCRIPTION VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci, LAST_UPDATED_STAMP DATETIME, LAST_UPDATED_TX_STAMP DATETIME, CREATED_STAMP DATETIME, CREATED_TX_STAMP DATETIME, CONSTRAINT PK_ACCOMMODATION_MAP_TYPE PRIMARY KEY (ACCOMMODATION_MAP_TYPE_ID)) TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'TYPE InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1

alvinchang
User offline. Last seen 15 weeks 5 days ago. Offline
Joined: 02/02/2012
I faced the same problem

I faced the same problem before. The problem is caused by the new version of MySQL database. The old version of rhe create table SQL statement had a TYPE clause. The new version of MySQL changed that to be ENGINE clause. So the statement should CREATE TABLE ... ENGINE InnoDB ...

You need to modify a couple of java source codes framework/sql/src/org/ofbiz/sql/Relation.java and framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java. Just replace the " TYPE " with " ENGINE ". Rebuild the app. It should work.

Hope it help

Alvin

Opentaps service provider erp crm   Site designed by IntegratingWeb with Drupal
© 2011 Open Source Strategies Inc.  Terms of Use