环境:

Kettle:kettle-spoon 版本stable release -4.3.0

Mysql:MySQL Server 5.5

 数据库连接信息:

 测试数据库连接情况。

 

 

错误连接数据库 [MySql-1] :org.pentaho.di.core.exception.KettleDatabaseException:

Erroroccured while trying to connect to the database

 

Exceptionwhile loading class

org.gjt.mm.mysql.Driver

 

org.pentaho.di.core.exception.KettleDatabaseException:

Erroroccured while trying to connect to the database

 

Exceptionwhile loading class

org.gjt.mm.mysql.Driver

 

 

         atorg.pentaho.di.core.database.Database.normalConnect(Database.java:368)

         at org.pentaho.di.core.database.Database.connect(Database.java:317)

         atorg.pentaho.di.core.database.Database.connect(Database.java:279)

         atorg.pentaho.di.core.database.Database.connect(Database.java:269)

         atorg.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:86)

         atorg.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464)

         atorg.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533)

         atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         atsun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

         atsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

         atjava.lang.reflect.Method.invoke(Unknown Source)

         atorg.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329)

         atorg.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139)

         atorg.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123)

         atorg.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26)

         atorg.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:119)

         atorg.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)

         atorg.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)

         atorg.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)

         atorg.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)

         atorg.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)

         atorg.eclipse.jface.window.Window.runEventLoop(Window.java:820)

         atorg.eclipse.jface.window.Window.open(Window.java:796)

         atorg.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:378)

         atorg.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:304)

         atorg.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:115)

         atorg.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:62)

         atorg.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.editConnection(SpoonDBDelegate.java:88)

         at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:2792)

         atorg.pentaho.di.ui.spoon.Spoon.access$1900(Spoon.java:310)

         atorg.pentaho.di.ui.spoon.Spoon$24.widgetDefaultSelected(Spoon.java:5275)

         atorg.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)

         at org.eclipse.swt.widgets.EventTable.sendEvent(UnknownSource)

         atorg.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)

         atorg.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)

         atorg.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)

         at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1183)

         atorg.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6968)

         atorg.pentaho.di.ui.spoon.Spoon.main(Spoon.java:567)

         atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at sun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)

         atsun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

         atjava.lang.reflect.Method.invoke(Unknown Source)

         atorg.pentaho.commons.launcher.Launcher.main(Launcher.java:134)

Causedby: org.pentaho.di.core.exception.KettleDatabaseException:

Exceptionwhile loading class

org.gjt.mm.mysql.Driver

 

         atorg.pentaho.di.core.database.Database.connectUsingClass(Database.java:423)

         atorg.pentaho.di.core.database.Database.normalConnect(Database.java:352)

         ... 43 more

Causedby: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

         atjava.net.URLClassLoader$1.run(Unknown Source)

         atjava.net.URLClassLoader$1.run(Unknown Source)

         atjava.security.AccessController.doPrivileged(Native Method)

         at java.net.URLClassLoader.findClass(UnknownSource)

         atjava.lang.ClassLoader.loadClass(Unknown Source)

         atjava.lang.ClassLoader.loadClass(Unknown Source)

         at java.lang.Class.forName0(NativeMethod)

         at java.lang.Class.forName(UnknownSource)

         at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:414)

         ... 44 more

 

主机名       : 192.168.2.1

端口           : 3306

数据库名:test

 

 

内事不决问百度,外事不决问谷歌。那就问问吧。

 

将对应的mysql驱动包(mysql-connector-java-5.1.15-bin.jar)放到下kettle的目录:data-integration\lib\下。

 下载地址:http://dev.mysql.com/downloads/connector/j/

重启再次进行连接测试通过。