kleineroscar / ReadExcelHeader

This Pentaho Data-Integration (PDI) step provides you with the column names and types from a excel file
Apache License 2.0
6 stars 1 forks source link

Error with SelectionAdapterFileDialogTextVar in PDI 8.3 #5

Open pablolivera opened 4 years ago

pablolivera commented 4 years ago

Hi Oscar,

First of all, I'd like to say thank you for what you have done!

I've installed the plugin in pentaho ce 8.3 but when I tried to open the dialog in a transformation it didn't open. The error: Unable to open dialog for this step java.lang.NoClassDefFoundError: org/pentaho/di/ui/core/events/dialog/SelectionAdapterFileDialogTextVar at de.oheimbrecht.ReadExcelHeader.ReadExcelHeaderDialog.open(ReadExcelHeaderDialog.java:870) at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:120) at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8814) at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3287) at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:785) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:200) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5797) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1374) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5051) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4583) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1384) at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7949) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9331) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:710) 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.commons.launcher.Launcher.main(Launcher.java:92) Caused by: java.lang.ClassNotFoundException: org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialogTextVar at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClassFromParent(KettleURLClassLoader.java:94) at org.pentaho.di.core.plugins.KettleURLClassLoader.loadClass(KettleURLClassLoader.java:114) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 20 more

I searched in the source code and the class SelectionAdapterFileDialogTextVar doesn't exist in pentaho 8.3, it was created in pentaho 9.

I fixed the error changing the implementation of the function wbbFilename.addSelectionListener, is almost the same code used in excel input step in the browse file dialog.

Here is the code working in pdi 8.3 and here in pdi 9.0.

If you agree with it, I will send a pull request.

kleineroscar commented 4 years ago

Hey Pablo, thanks for reaching out and already providing a fix. I pretty much exclusively use 9.0 by now, so I should remove the "Tested in 8.3" from the readme probably. It's probably the file browser that was added in 9.0 that includes access to mounted VFS storage as I understand it. I don't use any mounted storage so the new file browser is more of a hassle for me tbh.

If you could try the code in 9.0 I'd be happy to accept a pull request. On thing to note though is, that currently only xlsx files are supported. So maybe you could adjust the filter to this.

Thanks for contributing!