ofbiz切换到mysql,load-demo数据后,更新个公司名称报错

报错:

控制台报错

---- stack trace ---------------------------------------------------------------
java.lang.Exception: Failure in store operation for entity [PartyGroup]: org.ofbiz.entity.GenericEntityException: Error while updating: [GenericEntity:PartyGroup][annualRevenue,null()][comments,null()][createdStamp,2014-09-15 21:31:37.0(java.sql.Timestamp)][createdTxStamp,2014-09-15 21:31:37.0(java.sql.Timestamp)][groupName,测试公司(java.lang.String)][groupNameLocal,zh_CN(java.lang.String)][lastUpdatedStamp,2014-09-15 21:51:34.265(java.sql.Timestamp)][lastUpdatedTxStamp,2014-09-15 21:51:34.179(java.sql.Timestamp)][logoImageUrl,null()][numEmployees,null()][officeSiteName,null()][partyId,Company(java.lang.String)][tickerSymbol,null()] (SQL Exception while executing the following:UPDATE PARTY_GROUP SET GROUP_NAME=?, GROUP_NAME_LOCAL=?, OFFICE_SITE_NAME=?, ANNUAL_REVENUE=?, NUM_EMPLOYEES=?, TICKER_SYMBOL=?, COMMENTS=?, LOGO_IMAGE_URL=?, LAST_UPDATED_STAMP=?, LAST_UPDATED_TX_STAMP=?, CREATED_STAMP=?, CREATED_TX_STAMP=? WHERE PARTY_ID=? (Incorrect string value: '\xE6\xB5\x8B\xE8\xAF\x95...' for column 'GROUP_NAME' at row 1)). Rolling back transaction.

 

解决办法:

1. entityengine.xml中的对应设置 character-set="utf8" collate="utf8_general_ci"
2. 已经建好的数据库,还有相关的表的编码集必须是UTF-8
3. mysql client设置对应的编码集为UTF-8

重新load-demo,问题解决。

你可能感兴趣的:(mysql)