PiRSquared17 / jwpl

Automatically exported from code.google.com/p/jwpl
0 stars 1 forks source link

JWPL 0.8.0 still has the problem on "UTF8MB4" #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
public class Test {

    /**
     * @param args
     * @throws WikiApiException
     */
    public static void main(String[] args) throws WikiApiException {
        // TODO Auto-generated method stub
        DatabaseConfiguration dbConfig = new DatabaseConfiguration();
        dbConfig.setHost("localhost");
        dbConfig.setDatabase("wikipedia_zh");

        dbConfig.setUser("root");
        dbConfig.setPassword("4837078");
        dbConfig.setLanguage(Language.chinese); // Create the Wikipedia object

        Wikipedia wiki = new Wikipedia(dbConfig);
        //String title = "苹果";
        //Page page = wiki.getPage(title); // the title of the page
        Category category = wiki.getCategory("动物");
        Set<Page> pages = category.getArticles();

    }
}

Report:
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could 
not execute query
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.doList(Loader.java:2220)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2108)
    at org.hibernate.loader.Loader.list(Loader.java:2103)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1696)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
    at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
    at de.tudarmstadt.ukp.wikipedia.api.Category.createCategory(Category.java:102)
    at de.tudarmstadt.ukp.wikipedia.api.Category.<init>(Category.java:69)
    at de.tudarmstadt.ukp.wikipedia.api.Wikipedia.getCategory(Wikipedia.java:396)
    at Test.main(Test.java:34)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: COLLATION 
'utf8_bin' is not valid for CHARACTER SET 'utf8mb4'
    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:409)
    at com.mysql.jdbc.Util.getInstance(Util.java:384)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2275)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:187)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1791)
    at org.hibernate.loader.Loader.doQuery(Loader.java:674)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2217)
    ... 11 more

Original issue reported on code.google.com by fanmiao1...@gmail.com on 12 Jan 2012 at 1:07

GoogleCodeExporter commented 9 years ago

Original comment by oliver.ferschke on 12 Jan 2012 at 9:43

GoogleCodeExporter commented 9 years ago
I have the same error, I wrote abut this here:
http://code.google.com/p/jwpl/issues/detail?id=23
Comment 27, Yesterday (16 hours ago)

Original comment by michal.m...@gmail.com on 24 Jan 2012 at 11:17