我正在使用教程中列出的Hello World示例测试JWPL API:
https://code.google.com/p/jwpl/source/browse/trunk/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/tutorial/T1a_HelloWorld.java但是我收到以下MySQL连接异常:
02:11:31 . 057 INFO abstractpoolbackkeddatasource:462 - Initializing c3p0 pool…com.mchange.v2.c3p0。PoolBackedDataSource@f56923d7 [connectionPoolDataSource -> com.mchange.v2.c3p0.]WrapperConnectionPoolDataSource@76380f40 [acquireIncrement -> 3, acquireetryattempts -> 30, acquireetrydelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null,
]
我已经安装了MySQL 5.6.24,并且运行正常。在运行教程之前,我是否必须在MySQL中创建一些表来运行这些示例?
为清晰而编辑:
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
你的问题很不清楚你实际上遵循了什么步骤。您提到的唯一步骤是运行MySQL。那么,您查询的是什么数据呢?
JWPL文档完全是一团糟,但这似乎是有说明的页面:https://code.google.com/p/jwpl/wiki/DataMachine您必须导入维基百科数据(或任何其他MediaWiki wiki转储,我希望),是的,这包括创建一些表。