2012-07-24 117 views
58

我使用Pentaho的數據集成,我試圖通過MySQL的連接到我的數據庫,但是當我做我得到這個錯誤.....Pentaho的數據集成SQL連接

Error connecting to database [devdb2] : org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database 

Exception while loading class 
org.gjt.mm.mysql.Driver 


org.pentaho.di.core.exception.KettleDatabaseException: 
Error occured while trying to connect to the database 

Exception while loading class 
org.gjt.mm.mysql.Driver 


    at org.pentaho.di.core.database.Database.normalConnect(Database.java:368) 
    at org.pentaho.di.core.database.Database.connect(Database.java:317) 
    at org.pentaho.di.core.database.Database.connect(Database.java:279) 
    at org.pentaho.di.core.database.Database.connect(Database.java:269) 
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:86) 
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464) 
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533) 
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329) 
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139) 
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123) 
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26) 
    at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:119) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) 
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) 
    at org.eclipse.jface.window.Window.open(Window.java:796) 
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:378) 
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:304) 
    at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:115) 
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:62) 
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:493) 
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:478) 
    at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:7770) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329) 
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139) 
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123) 
    at org.pentaho.ui.xul.swt.tags.SwtMenuitem.access$100(SwtMenuitem.java:27) 
    at org.pentaho.ui.xul.swt.tags.SwtMenuitem$1.widgetSelected(SwtMenuitem.java:77) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) 
    at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1183) 
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6966) 
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:567) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134) 
Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
Exception while loading class 
org.gjt.mm.mysql.Driver 

    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:423) 
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:352) 
    ... 50 more 
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver 
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.lang.Class.forName0(Native Method) 
    at java.lang.Class.forName(Unknown Source) 
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:414) 
    ... 51 more 

如果我使用SQLite作爲我的連接類型的作品,但沒有數據返回時,我去探索它。所以我的問題是我如何讓MySQL工作或使用SQLite獲取數據?

我是否缺少圖書館或班級?

回答

11

原來我會丟失一個名爲mysql-connector-java-5.1.2.jar的類,我將它添加到該文件夾​​中(C:\ Program Files \ pentaho \ design-tools \ data-integration \ lib)使用MySQL連接,我的數據和表格出現。

+0

工作GR8,但計劃作業.Cannot找到問題的dirver:

然後,在/your/path/to/data-integration/lib/創建符號鏈接。我已經在tomcat \ webapps \ pentaho \ WEB-INF \ lib中包含驅動程序,但仍然....任何想法在哪個位置mysql驅動程序缺少..? – Surya 2014-04-07 06:13:08

13

缺少驅動程序文件。

這個錯誤對於剛開始使用PDI的人來說非常普遍。

驅動程序進入\ pentaho \ design-tools \ data-integration \ libext \ JDBC for PDI。如果您在Pentaho套件中使用其他工具,則可能需要將驅動程序複製到這些工具的其他位置。作爲參考,這裏有一些其他設計工具相應的文件夾:

  • 匯聚設計師:\ Pentaho的\設計工具\聚集設計師\ DRIVERS
  • 元數據編輯器:\ Pentaho的\設計工具\元數據編輯器\ libext \ JDBC
  • 報表設計器:\ Pentaho的\設計工具\報告設計師\ LIB \ JDBC
  • 架構工作臺:\ Pentaho的\設計工具\架構工作臺\ DRIVERS

如果這個轉型或工作會在測試或生產服務器等其他框上運行,不要忘記在部署注意事項中包含複製jar文件並重新啓動PDI或Data Integration Server。

116

我試圖從Pentaho查詢MySQL數據庫時遇到了同樣的問題。

錯誤連接到數據庫[本地MySQL數據庫]:org.pentaho.di.core.exception.KettleDatabaseException: 錯誤嘗試連接到數據庫發生

異常而加載類 org.gjt .mm.mysql.Driver

通過@擴大後user979331的解決方案是:

  1. 下載Latest MySQL Java Connector/Driver
  2. 解壓ZIP文件(對我來說這是mysql-connector-java-5.1.31.zip
  3. 副本的.jar文件(mysql-connector-java-5.1.31-bin。罐子)和粘貼它在你的文件夾:

    PC: C:\ Program Files文件\ Pentaho的\設計工具\數據集成\ lib中

    的Mac: /應用/ data-integration/lib

重新啓動Pentaho(數據集成)並重新測試MySQL連接。

+0

你知道BI服務器對應的文件夾是什麼嗎? – decal 2013-06-11 22:31:02

+1

老兄,你太棒了! – Stormsson 2013-09-17 14:09:27

+1

我粘貼了jar文件的最新連接,但是錯誤仍然存​​在 – 2013-10-29 14:42:42

6

除了這裏其他的答案,這裏是你如何能做到這在Ubuntu(14.04):

sudo apt-get install libmysql-java

這將下載mysql-connector-java-5.x.x.jar/usr/share/java/,我相信還會自動創建一個名爲mysql-connector-java.jar符號鏈接。從勺子

ln -s /usr/share/java/mysql-connector-java.jar /your/path/to/data-integration/lib/mysql-connector-java.jar