]
Trong Tran updated GTNPORTAL-3517:
----------------------------------
Fix Version/s: 3.9.0.Final
Cannot start Gatein Portal with MySQL in UTF-8
----------------------------------------------
Key: GTNPORTAL-3517
URL:
https://issues.jboss.org/browse/GTNPORTAL-3517
Project: GateIn Portal
Issue Type: Task
Security Level: Public(Everyone can see)
Affects Versions: 3.5.10.Final
Reporter: Tran Trung Thanh
Fix For: 3.9.0.Final
If we want to use Gatein Portal in UTF-8 mode with MySQL, even if we configure the
dialect to mysql-utf8, we get issues of type:
{code}
Caused by: org.jboss.cache.CacheException: Unable to start cache loaders
at
org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoaderManager.java:470)
~[jbosscache-core-3.2.7.GA.jar:3.2.7.GA]
... 81 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was
too long; max key length is 1000 bytes
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0_45]
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
~[na:1.6.0_45]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
~[na:1.6.0_45]
at java.lang.reflect.Constructor.newInstance(Constructor.java:513) ~[na:1.6.0_45]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4098)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4030)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2671)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1749)
~[mysql-connector-java-5.1.19.jar:na]
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1666)
~[mysql-connector-java-5.1.19.jar:na]
at
org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
~[tomcat-dbcp.jar:7.0.42]
at
org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
~[tomcat-dbcp.jar:7.0.42]
at
org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
~[tomcat-dbcp.jar:7.0.42]
at org.jboss.cache.loader.AdjListJDBCCacheLoader.start(AdjListJDBCCacheLoader.java:300)
~[jbosscache-core-3.2.7.GA.jar:3.2.7.GA]
at org.jboss.cache.loader.JDBCCacheLoader.start(JDBCCacheLoader.java:396)
~[jbosscache-core-3.2.7.GA.jar:3.2.7.GA]
at
org.exoplatform.services.jcr.impl.core.lock.jbosscache.ControllerCacheLoader.start(ControllerCacheLoader.java:312)
~[exo.jcr.component.core-1.15.8-GA-SNAPSHOT.jar:1.15.8-GA-SNAPSHOT]
at
org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoaderManager.java:464)
~[jbosscache-core-3.2.7.GA.jar:3.2.7.GA]
{code}
NB: The db schema has been created using the next command:
{code}
CREATE DATABASE plf_jcr_utf8 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
{code}
To make Gatein Portal work with MySQL in UTF-8, we need
[
JCR-2312|https://jira.exoplatform.org/browse/JCR-2312] and add new parameter introduced
from JCR issue in the configuration of the lock manager which is
infinispan-cl-cache.jdbc.dialect in case of infinispan and
jbosscache-cl-cache.jdbc.dialect in case of JBC.