HiromuHota / webspoon-docker

Dockerfile for webSpoon
https://hub.docker.com/r/hiromuhota/webspoon/
Apache License 2.0
103 stars 61 forks source link

Driver class 'org.gjt.mm.mysql.Driver' could not be found #17

Closed tigitz closed 6 years ago

tigitz commented 6 years ago

Hello,

I think having the mysql native driver out of the box in the image would be great for those who want to rapidly test webspoon with an existing database.

Here's error if needed:

Error connecting to databas :org.pentaho.di.core.exception.KettleDatabaseException: 
Error occurred while trying to connect to the database

Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver

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

Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver

    at org.pentaho.di.core.database.Database.normalConnect(Database.java:472)
    at org.pentaho.di.core.database.Database.connect(Database.java:370)
    at org.pentaho.di.core.database.Database.connect(Database.java:341)
    at org.pentaho.di.core.database.Database.connect(Database.java:331)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2786)
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:619)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:43)
    at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:137)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:263)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:109)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:687)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:594)
    at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1217)
    at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1198)
    at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:869)
    at org.eclipse.jface.window.Window.open(Window.java:845)
    at org.pentaho.di.ui.xul.KettleDialog.show(KettleDialog.java:80)
    at org.pentaho.di.ui.xul.KettleDialog.show(KettleDialog.java:47)
    at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:116)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:60)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:494)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:481)
    at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:9017)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
    at org.pentaho.ui.xul.jface.tags.JfaceMenuitem.access$100(JfaceMenuitem.java:43)
    at org.pentaho.ui.xul.jface.tags.JfaceMenuitem$1.run(JfaceMenuitem.java:106)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:493)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:403)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:109)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:687)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:594)
    at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1217)
    at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1198)
    at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
    at org.eclipse.rap.rwt.application.AbstractEntryPoint.createUI(AbstractEntryPoint.java:69)
    at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
    at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290)
    at java.lang.Thread.run(Thread.java:748)
    at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver

    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:515)
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:456)
    ... 57 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:490)
    ... 58 more

Thanks

HiromuHota commented 6 years ago

Hi. Thanks for the great suggestion. I agree with the idea that having native JDBC drivers, plugins, etc. would be great, but I cannot include all of them. Because this is making the image even more fat and there always will be new things people want.

I personally think mysql driver is good to be included, but it is very hard to decide what to be included and what to be not. Instead of setting the boundary myself, I chose to include only the drivers packaged in the community edition. Having said, you are free to extend the Docker image by including the mysql driver.

ghost commented 5 years ago

.. but it doesn't work :). I have the same error. Can you tell me how to fix it??

HiromuHota commented 5 years ago

Which version of mysql JDBC driver did you try and did you restart webSpoon after you placed jdbc driver to $CATALINA_HOME/lib?

I did the following and it worked.

$ docker run --name webspoon -d -p 8080:8080 hiromuhota/webspoon:nightly
$ docker exec -it webspoon bash
tomcat@01b5622af891:/usr/local/tomcat$ wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.zip
tomcat@01b5622af891:/usr/local/tomcat$ unzip mysql-connector-java-5.1.47.zip 
tomcat@01b5622af891:/usr/local/tomcat$ cp mysql-connector-java-5.1.47/mysql-connector-java-5.1.47-bin.jar lib/
$ docker restart webspoon

I tested on a nightly build of webspoon but released versions should work too. The same applies to mysql: I used 5.X for both driver and server but 8.0 should work too.

ghost commented 5 years ago

I deinstalled Pentaho and installed Birt. It works very good :). I had installed the JDBC 5.1.4.6 and 8.0.16, thanks for your help, I'm happy with Birt. Best Dragan

ghost commented 5 years ago

I just tried to install the JDBC database driver again and it doesn't work.

I copied mysql-connector-java-8.0.16.jar to /Applications/Pentaho Report Designer.app/lib and to /Applications/Pentaho Report Designer.app/lib/jdbc java-Version: 9.0.4. Any suggestions?? Best Dragan

HiromuHota commented 5 years ago

For webSpoon, the copy destination is neither /Applications/Pentaho Report Designer.app/lib nor /Applications/Pentaho Report Designer.app/lib/jdbc.

The destination should be $CATALINA_HOME/lib like the below. webapps/spoon.war should be next to the lib folder.

$CATALINA_HOME
├── system
├── plugins
├── lib
│   ├── mysql-connector-java-8.0.16.jar
│   ├── ...
├── webapps
│   ├── spoon.war
│   ├── ...

Did you use Docker to deploy webSpoon? If so, you have to place the JDBC driver at $CATALINA_HOME/lib of the deployed Docker container.

ghost commented 5 years ago

Hello, sorry, Ive forgotten to tell you, my problems are concerning the Pentaho report designer.

HiromuHota commented 5 years ago

I've never used the report designer, so I can't help...