Pentaho Data Integration SQL connection - mysql

I am using Pentaho Data Integration and I am trying to connect to my database via MySQL but when I do I get this error.....
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
If I used SQLite as my Connection Type it works but no data is returned when I goto explore it. So my question is how do I get MySQL working or get the data using SQLite?
Am I missing a library or a class?

I just came across the same issue while trying to query a MySQL Database from Pentaho.
Error connecting to database [Local MySQL DB] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Exception while loading class
org.gjt.mm.mysql.Driver
Expanding post by #user979331 the solution is:
Download the MySQL Java Connector / Driver that is compatible with your kettle version
Unzip the zip file (in my case it was mysql-connector-java-5.1.31.zip)
copy the .jar file (mysql-connector-java-5.1.31-bin.jar) and paste it in your Lib folder:
PC: C:\Program Files\pentaho\design-tools\data-integration\lib
Mac: /Applications/data-integration/lib
Restart Pentaho (Data Integration) and re-test the MySQL Connection.
Additional interesting replies from others that could also help:
think to download the good JDBC driver version, compatible with your
PDI version:
https://help.pentaho.com/Documentation/8.1/Setup/JDBC_Drivers_Reference#MY_SQL
take the zip version ("platform independant") to extract the jar file
take into lib folder
see also proper way to handle it proposed by Ryan Tuck

Missing driver file.
This error is really common for people just getting started with PDI.
Drivers go in \pentaho\design-tools\data-integration\libext\JDBC for PDI. If you are using other tools in the Pentaho suite, you may need to copy drivers to additional locations for those tools. For reference, here are the appropriate folders for some of the other design tools:
Aggregation Designer: \pentaho\design-tools\aggregation-designer\drivers
Metadata Editor: \pentaho\design-tools\metadata-editor\libext\JDBC
Report Designer: \pentaho\design-tools\report-designer\lib\jdbc
Schema Workbench: \pentaho\design-tools\schema-workbench\drivers
If this transformation or job will run on another box, such as a test or production server, don't forget to include copying the jar file and restarting PDI or the Data Integration Server in your deployment considerations.

Turns out I will missing a class called mysql-connector-java-5.1.2.jar, I added it this folder (C:\Program Files\pentaho\design-tools\data-integration\lib) and it worked with a MySQL connection and my data and tables appear.

You need to download mysql-connector-java-5.1.46.tar.gz, not the latest version. The Driver class that Pentaho uses is not included in mysql-connector-java-8.xx.yy versions.

In addition to the other answers here, here's how you can do it on Ubuntu (14.04):
sudo apt-get install libmysql-java
this will download mysql-connector-java-5.x.x.jar to /usr/share/java/, which i believe also automatically creates a symlink named mysql-connector-java.jar.
Then, create a symlink in /your/path/to/data-integration/lib/:
ln -s /usr/share/java/mysql-connector-java.jar /your/path/to/data-integration/lib/mysql-connector-java.jar

At the present time, there is a simple way to fix this problem:
Go to Tools → MarketPlace and search for "PDI MySQL Plugin"
Install it ( this will automatically install the missing driver here: data-integration\plugins\databases\pdi-mysql-plugin\lib )
Restart Pentaho
Done.

To be concise and precise download the compatible jdbc (.jar) file compatible with your MySql version and put it in lib folder.
For example for MySQL 8.0.2 download Connector/J 8.0.20

Above answers were helpful, but for unknown reasons they did not seem to work.
So if you have already installed MySql workbench on your system, instead of downloading the jar files and struggling with the correct version just go to
C:\Program Files (x86)\MySQL\Connector J 8.0
and copy mysql-connector-java-8.0.12 (does not matter what version it is) the jar file in that location and paste it to C:\Program Files\pentaho\design-tools\data-integration\lib

First of all you need to download Mysql connector which is compatible with your pentaho version.after that paste it to data-integration/lib folder and restart your pentaho.
check this
https://help.pentaho.com/Documentation/8.1/Setup/JDBC_Drivers_Reference#MY_SQL

Related

How to change from derby to MySQL in Spark

I have installed a spark 2.4.7 using "spark-2.4.7-bin-hadoop2.6.tgz"
I could see the metastore_db got created automatically under the usr home directory and it contains derby database. Also when I developer runs a query it throws error like below
Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:derby:;databaseName=metastore_db;create=true, username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1#6cde460, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
we are not planning to use derby database, I have MySQL database ready on a different host, can some one please help me understand how can I change the config to point my spark to MySQL instead of the derby??
Thanks in advance
Suresh

install4j throw java.lang.NoClassDefFoundError: com.install4j.runtime.beans.screens.SystemFormScreen error

I try to install JRuby - which uses install4j installer - on Windows 10 64 bit OS. Java runtime version: 1.8.0_171-b11.
I get following error message in log file during installation process and install is terminated.
java.lang.RuntimeException: java.lang.NoClassDefFoundError: com.install4j.runtime.beans.screens.SystemFormScreen
at com.install4j.runtime.installer.frontend.GUIHelper.invokeOnEDT(GUIHelper.java:711)
at com.install4j.runtime.installer.config.AbstractBeanConfig.finishBatch(AbstractBeanConfig.java:51)
at com.install4j.runtime.installer.ContextImpl.registerScreens(ContextImpl.java:694)
at com.install4j.runtime.installer.controller.Controller.start(Controller.java:75)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58)
at com.install4j.runtime.installer.Installer.main(Installer.java:45)
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 com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Caused by: java.lang.NoClassDefFoundError: com.install4j.runtime.beans.screens.SystemFormScreen
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at com.sun.beans.finder.MethodFinder$1.create(Unknown Source)
at com.sun.beans.finder.MethodFinder$1.create(Unknown Source)
at com.sun.beans.util.Cache.get(Unknown Source)
at com.sun.beans.finder.MethodFinder.findMethod(Unknown Source)
at java.beans.Statement.getMethod(Unknown Source)
at java.beans.Statement.invokeInternal(Unknown Source)
at java.beans.Statement.access$000(Unknown Source)
at java.beans.Statement$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Statement.invoke(Unknown Source)
at java.beans.Expression.getValue(Unknown Source)
at com.sun.beans.decoder.ObjectElementHandler.getValueObject(Unknown Source)
In your case JVM uses options which cannot be used by Ruby/SoapUI correctly.
JAVA_OPTIONS
IBM_JAVA_OPTIONS
JAVA_TOOL_OPTIONS
To work around the issue, you can do the following:
Use Task Manager to completely close the HP UFT and/or Oracle Single
Sign-On software or service.
Remove the JAVA_TOOL_OPTIONS, IBM_JAVA_OPTIONS and _JAVA_OPTIONS OS environment variables.
Also before removing the "JAVA_TOOL_OPTIONS, IBM_JAVA_OPTIONS and _JAVA_OPTIONS" kindly save the information in Notepad. Once after installing, again add"JAVA_TOOL_OPTIONS, IBM_JAVA_OPTIONS and _JAVA_OPTIONS" to your Environmental variables else HPUFT or Oracle SSO will have issue while launching.
else create a bat file and call your installer in the below content and execute the bat file [Jrubyinstall.bat (any prefered filename)] place the batfile in same folder as your installer is placed.
set IBM_JAVA_OPTIONS=
set _JAVA_OPTIONS=
set JAVA_TOOL_OPTIONS=
jruby_windows_9_2_8_0.exe
[Optional --- only if you required to launch it
The above solution is to Install the application,
But to execute it, create a bat file in place of installation [mostly in bin folder]
inside the Bat file:
set IBM_JAVA_OPTIONS=
set _JAVA_OPTIONS=
set JAVA_TOOL_OPTIONS=
[your executable file] xxx.exe/jar/...
and save it. every time you can launch the application via BAT file. ]

Cant connect to MySQL via Squirrel - Unable to create connection. Check your URL

I can't connect to our database using Squirrel. I am certain my URL is correct as I'm using it via my java code to access the database.
I got the drivers from here: http://dev.mysql.com/downloads/file.php?id=454395
What is interesting is when I add the driver to MySQL in squirrel it shows it as:
com.mysql.fabric.jdbc.FabricMySQLDriver
In the past when I've used squirrel it would just show com.mysql.jdbc.Driver and no "fabric" stuff.
Stack trace:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: Unable to create connection. Check your URL.
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Unable to create connection. Check your URL.
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
... 5 more
Caused by: java.sql.SQLException: Unable to create connection. Check your URL.
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:136)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
... 7 more
Double-click on the MySQL driver in the Drivers window. Take a look at the class name dropdown at the bottom of the newly opened window. Click on the dropdown arrow and see if you can select the original com.mysql.jdbc.Driver class name.

Tips on getting Hudson / Jenkins working on Unix System Services z/OS

I've read that it is possible to get a Hudson slave running on [zOS (under Unix System Services).] (http://jenkins.361315.n4.nabble.com/Hudson-slave-to-z-OS-td2265091.html)
When I try it (even with the JVM option -Dfile.encoding=ISO8859_1) I get:
[11/30/11 22:09:40] [SSH] Checking java version of /userhome/mjb/hudson/jdk/bin/java
[11/30/11 22:09:44] [SSH] /userhome/mjb/hudson/jdk/bin/java -version returned 1.6.0.
[11/30/11 22:09:44] [SSH] Starting sftp client.
[11/30/11 22:09:46] [SSH] Copying latest slave.jar...
[11/30/11 22:09:57] [SSH] Copied 216,629 bytes.
[11/30/11 22:09:58] [SSH] Starting slave process: cd '/userhome/mjb/hudson' && /userhome/mjb/hudson/jdk/bin/java -Dfile.encoding=ISO8859_1 -jar slave.jar
<===[HUDSON REMOTING CAPACITY]===> java.io.StreamCorruptedException: invalid stream header: D0D20009
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at hudson.remoting.Channel.<init>(Channel.java:364)
at hudson.remoting.Channel.<init>(Channel.java:276)
at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:297)
at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:322)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:184)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[11/30/11 22:10:01] [SSH] Connection closed.
I am currently using Hudson ver. 1.376. Is it worth upgrading? Any other tips greatly appreciated?
The magic option is -text.
Launch your slave with:
java -Dfile.encoding=ISO8859_1 -jar slave.jar -text
It will fix the communication issue.
The page you mention says that it should be possible. But the defect that was open at https://issues.jenkins-ci.org/browse/JENKINS-13091 is not resolved yet... :(

Installing hudson slave on windows xp

I am trying to install a slave on windows xp on a different machine from the master. I tried clicking on new node and it only give me the option of choosing dumb slave. Is it supposed to be like that? Anyway, I fill out the node name as "Test" and i select launch using jnlp and i hit save. Now when I click on that node i download the slave-agent.jnlp and slave.jar files from that screen and i open a command prompt and enter java -jar slave.jar -jnlpUrl http://servername:portnumber/hudson/computer/Test/slave-agent.jnlp but I get the following java errors:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at hudson.remoting.Engine.connect(Engine.java:265)
at hudson.remoting.Engine.run(Engine.java:185)
When i try to run it from the web interface it cannot connect and it looks like it is trying to use a port number like 59870 instead of the real portnumber to connect to the host. Does anyone know why I can't install the slave agent?
found it. You need to open that port number on the machine the master slave is on.