java.lang.NoClassDefFoundError:org/hamcrest/SelfDescribing
多方查找,發現是少了hamcrest包。將hamcrest-core.jar加入到Build Path就可以了。
下載地址:http://www.java2s.com/Code/Jar/h/hamcrest.htm
後來有個錯誤看不懂,給測試類加上一個main方法,把測試放進去執行:
public static void main(String[] args) {
new TestStudent().testSchemaExport();
}
然後出現錯誤
Cannot load JDBC driver class 'com.MySQL.jdbc.Driver’
一般是連接字符串的問題,這個之前也遇到過,之前用了這樣的連接字符串就好了
jdbc:mysql://localhost:3306/test?zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8
事實證明這次也管用。起碼這個問題在我的環境下解決了。