Waikato / moa

MOA is an open source framework for Big Data stream mining. It includes a collection of machine learning algorithms (classification, regression, clustering, outlier detection, concept drift detection and recommender systems) and tools for evaluation.
http://moa.cms.waikato.ac.nz/
GNU General Public License v3.0
609 stars 353 forks source link

Cannot select result directory in experimenter #180

Closed henrygouk closed 5 years ago

henrygouk commented 5 years ago

When I click the Browse button to select a results directory in the new Experimenter tab, I get the following error in the terminal:

java.lang.NullPointerException
        at com.github.fracpete.jshell.JShellPanel.updateButtons(JShellPanel.java:238)
        at com.github.fracpete.jshell.JShellPanel.finishInit(JShellPanel.java:217)
        at nz.ac.waikato.cms.gui.core.BasePanel.<init>(BasePanel.java:52)
        at nz.ac.waikato.cms.gui.core.BasePanel.<init>(BasePanel.java:40)
        at com.github.fracpete.jshell.JShellPanel.<init>(JShellPanel.java:67)
        at moa.gui.ScriptingTabPanel.<init>(ScriptingTabPanel.java:47)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at moa.gui.GUI.initGUI(GUI.java:64)
        at moa.gui.GUI.<init>(GUI.java:46)
        at moa.gui.GUI$1.run(GUI.java:97)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
        at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:848)
        at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:633)
        at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:598)
        at com.jidesoft.swing.FolderChooser.updateUI(FolderChooser.java:128)
        at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:382)
        at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:348)
        at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:295)
        at com.jidesoft.swing.FolderChooser.<init>(FolderChooser.java:63)
        at nz.ac.waikato.cms.gui.core.BaseDirectoryChooser.<init>(BaseDirectoryChooser.java:61)
        at moa.gui.experimentertab.TaskManagerTabPanel.openDirectory(TaskManagerTabPanel.java:605)
        at moa.gui.experimentertab.TaskManagerTabPanel.jButtonDirActionPerformed(TaskManagerTabPanel.java:624)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
        at java.desktop/java.awt.Component.processEvent(Component.java:6397)
        at java.desktop/java.awt.Container.processEvent(Container.java:2263)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 46 more

This is on Ubuntu 18.04.2 LTS.

fracpete commented 5 years ago

Are you on an up-to-date git clone or latest snapshot? Based on the stacktrace, I'd say you're still using a version from prior to my fix last week.

henrygouk commented 5 years ago

This is using the 2019.05 release available from Maven. Is there some documentation somewhere about how to build/run moa from source so I can see if this is fixed in master?

Interestingly, when I try to do the same thing with X forwarding over SSH to a laptop running Ubuntu 16.04.2 LTS, it works fine.

fracpete commented 5 years ago

I submitted a fix last week. Can you please try with the latest snapshot: https://adams.cms.waikato.ac.nz/snapshots/moa/

henrygouk commented 5 years ago

I still get a stack trace and no dialog. Here is the updated terminal output:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:848)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:633)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:598)
    at com.jidesoft.swing.FolderChooser.updateUI(FolderChooser.java:128)
    at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:382)
    at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:348)
    at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:295)
    at com.jidesoft.swing.FolderChooser.<init>(FolderChooser.java:63)
    at nz.ac.waikato.cms.gui.core.BaseDirectoryChooser.<init>(BaseDirectoryChooser.java:61)
    at moa.gui.experimentertab.TaskManagerTabPanel.openDirectory(TaskManagerTabPanel.java:605)
    at moa.gui.experimentertab.TaskManagerTabPanel.jButtonDirActionPerformed(TaskManagerTabPanel.java:624)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6397)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 46 more

Here are the details for the version of Java I am using:

openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)
fracpete commented 5 years ago

This is rather weird that it tries to instantiate the Windows L&F. Can you please add the following parameter to your command-line for starting up MOA, to enforce the cross-platform L&F?

-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
henrygouk commented 5 years ago

Running

java -classpath '/tmp/moa-release-2019.05.1-SNAPSHOT/lib/*' \
     -Xmx512m \
     -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel \
     -javaagent:/tmp/moa-release-2019.05.1-SNAPSHOT/lib/sizeofag-1.0.4.jar \
     moa.gui.GUI

Gives the same stacktrace when clicking the browse button

fracpete commented 5 years ago

OK, I've centralized the Look'n'Feel handling and (with the latest code/snapshot) you can now configure it in the GUI.props file. Place a GUI.props in your home directory with this content:

LookAndFeel=crossplatform
JideLookAndFeel=0

Biggest problem for me is that I cannot replicate your issue at my end, so I'm just stabbing in the dark...

henrygouk commented 5 years ago

Not sure if this is expected, but starting the latest snapshot without the GUI.props file cauases the following stack trace:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:848)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:633)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:598)
    at moa.gui.LookAndFeel.install(LookAndFeel.java:126)
    at moa.gui.GUI$1.run(GUI.java:84)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 18 more

When starting with the GUI.props file, everything works perfectly.

fracpete commented 5 years ago

Thanks, Henry. I didn't expect the centralizing of the LnF handling to fix the issue. However, by being able to manually override any heuristics that determine the LnF that should be used, we can at least now make things work again. I added a section to the MOA manual regarding the LnF, describing how to override the settings.

henrygouk commented 5 years ago

To clarify, that most recent stack trace occurs when starting MOA, not when clicking the browse button, and results in MOA crashing. I'm happy to use the GUI.props workaround, but just thought you should know about this new related bug.

fracpete commented 5 years ago

I see. I just made some small changes to automatically fall back to the settings that you manually set in GUI.props. Please download a new snapshot, rename your GUI.props to GUI.old and try starting up MOA via its start up bash script.

henrygouk commented 5 years ago
Using built-in strategy for setting Look'n'Feel...
Using built-in strategy for setting JIDE Look'n'Feel...
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:848)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:633)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:598)
    at moa.gui.LookAndFeel.install(LookAndFeel.java:127)
    at moa.gui.GUI$1.run(GUI.java:84)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 18 more
fracpete commented 5 years ago

Ah, bummer... Missed that an error rather than an exception was thrown. Catching Throwable now, which should solve it. New snapshot is available. Thanks for your patience! I should only work on one thing at a time... :-)

henrygouk commented 5 years ago
Using built-in strategy for setting Look'n'Feel...
Using built-in strategy for setting JIDE Look'n'Feel...
Failed to install JIDE Look'n'Feel based on built-in strategy, attempting to use style: 0
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:848)
    at com.jidesoft.plaf.LookAndFeelFactory.installJideExtension(LookAndFeelFactory.java:633)
    at moa.gui.LookAndFeel.install(LookAndFeel.java:131)
    at moa.gui.GUI$1.run(GUI.java:84)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
fracpete commented 5 years ago

OK, I've reworked the whole logic and in case of problems with installing the JIDE style, it just falls back on the cross-platform look and feel and JIDE style "0". New snapshot is available.

henrygouk commented 5 years ago

Everything is working perfectly! Thanks for sorting this out

fracpete commented 5 years ago

Excellent! Thanks for your patience! :-)