Pentaho Data Integration - Kettle
  1. Pentaho Data Integration - Kettle
  2. PDI-6768

Test button on the database connection dialog for plugin connections (like OpenERP, Palo) returns ClassNotFoundException

    Details

    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      This doesn't happen on the development environment using Eclipse but it happens on a finished build.

      To reproduce:
      1. Download the latest version from the CI server, for example pdi-ce-4.3.0-M1-r15785.tar.gz; or do a build on the current trunk and run kettle from the distrib directory.
      2. Create a new Palo or OpenERP connection and enter anything in the connection parameters. It doesn't need to be valid.
      3. Press the test button.

      Then you get the errors listed below. Interestingly the steps still work that make use of the connections (as far as I've tested). It only seems to affect the database connection dialog.
      OpenERP Connection
      I'm sorry, we can't create a test report for this database.

      Error connecting to database [dbw_openerp1] : java.lang.ClassNotFoundException: org.pentaho.di.openerp.core.OpenERPHelper
      java.lang.ClassNotFoundException: org.pentaho.di.openerp.core.OpenERPHelper
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
      	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:186)
      	at org.pentaho.di.core.database.DatabaseMeta.getDatabaseFactory(DatabaseMeta.java:2471)
      	at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2454)
      	at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:511)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	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:104)
      	at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:51)
      	at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.editConnection(SpoonDBDelegate.java:78)
      	at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:2778)
      	at org.pentaho.di.ui.spoon.Spoon.access$1900(Spoon.java:299)
      	at org.pentaho.di.ui.spoon.Spoon$24.widgetDefaultSelected(Spoon.java:5258)
      	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:1169)
      	at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6938)
      	at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:553)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
      

      Palo Error:
      I'm sorry, we can't create a test report for this database.

      Error connecting to database [dbw_openerp1] : java.lang.ClassNotFoundException: org.pentaho.di.palo.core.PaloHelper
      java.lang.ClassNotFoundException: org.pentaho.di.palo.core.PaloHelper
      	(Same stack trace as before)
      

      It didn't happen when I last tested (around 10 builds ago?), but I didn't have enough time to check at which revision it broke.

        Activity

        The program that starts Kettle (launchar.jar) sets the classpath from the launcher.properties file. Plugin jar files in the plugins directory aren't part of the default classpath. Each plugin makes use of a different class loader to load its classes.

        When the test button in the Database Connection Dialog is pressed, the required database factory class is loaded using the default class loader. If the database factory is handled by a plugin (like OpenERP and Palo), the database factory classes can't be loaded because the default classpath doesn't include the plugin jar files.

        The expected behaviour is that the classes are loaded using the relevant plugin class loader.

        It has been changed to work as expected.

        Show
        Pieter van der Merwe (De Bortoli Wines, Australia) added a comment - The program that starts Kettle (launchar.jar) sets the classpath from the launcher.properties file. Plugin jar files in the plugins directory aren't part of the default classpath. Each plugin makes use of a different class loader to load its classes. When the test button in the Database Connection Dialog is pressed, the required database factory class is loaded using the default class loader. If the database factory is handled by a plugin (like OpenERP and Palo), the database factory classes can't be loaded because the default classpath doesn't include the plugin jar files. The expected behaviour is that the classes are loaded using the relevant plugin class loader. It has been changed to work as expected.
        Hide
        Bryan Rosander (Inactive) added a comment -

        I can't get either test button to work, OpenERP hangs indefinitely, Palo still gives class not found

        Show
        Bryan Rosander (Inactive) added a comment - I can't get either test button to work, OpenERP hangs indefinitely, Palo still gives class not found

          People

          • Assignee:
            Aliaksandr Bialkevich
            Reporter:
            Pieter van der Merwe (De Bortoli Wines, Australia)
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: