I've tried to deploy my simple little Spring Social app onto CloudFoundry and get the following message from the MySQL service I've chosen to use:
I'm using Spring Social version 1.0.2.RELEASE, Spring Framework 3.1.1.RELEASE and MySQL connector 5.1.19.Code:Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource class path resource [org/springframework/social/connect/jdbc/JdbcUsersConnectionRepository.sql]: create table UserConnection (userId varchar(255) not null, providerId varchar(255) not null, providerUserId varchar(255), rank int not null, displayName varchar(255), profileUrl varchar(512), imageUrl varchar(512), accessToken varchar(255) not null, secret varchar(255), refreshToken varchar(255), expireTime bigint, primary key (userId, providerId, providerUserId)) at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.executeSqlScript(ResourceDatabasePopulator.java:199) at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:132) at com.justgoodpeople.mvp2.account.AccountRepositoryJpaImpl.<init>(AccountRepositoryJpaImpl.java:27) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ... 54 more 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) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
When will you have a fix for it? I believe the issue is that the default MyISAM storage engine for MySQL doesn't allow index keys longer than 1000 characters. The solution is to change it to use InnoDb. That being said, I realize that it can be arduous to cover off all different databases, but I think that Spring Social should work on your own cloud infrastructure out-of-the-box.
Any recommended workaround that doesn't include hacking the Spring Social jar?
Other than that works great!![]()


Reply With Quote
Thanks for the wake up call/clarification!
