zoukankan      html  css  js  c++  java
  • Kettle连接Mysql数据库异常

    环境:

    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\libext\JDBC下。

    再次进行连接测试通过。

  • 相关阅读:
    求助,eclipse总是卡在building workspace-CSDN论坛
    java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar
    Oracle修改默认字符编码
    mysql修改数据库编码(数据库字符集)和表的字符编码的方法
    如何把maven项目转成web项目
    解决Cannot change version of project facet Dynamic Web M
    YII 框架查询
    SpringBoot项目如何进行打包部署
    Java并发—— 关键字volatile解析
    牛客网刷题(纯java题型 31~60题)
  • 原文地址:https://www.cnblogs.com/littlehb/p/3062402.html
Copyright © 2011-2022 走看看