Unable to create GUI on startup

Greetings,

First, thanks so much for creating such an awesome piece of software. Brainstorm rocks.

The problem: A few days ago I was able to use Brainstorm (Oct-15-2015 version) on 64-bit Ubuntu 14.04 without issue. Today, Brainstorm (both Oct-15-2015 and Nov-11-2015 versions) are unable to start up, because the GUI creation fails. Here’s the printout:


>> brainstorm
 
BST> Starting Brainstorm:
BST> =================================
BST> Version: 11-Nov-2015
BST> Compiling main interface files...
BST> Emptying temporary directory...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Checking internet connectivity... ok
BST> Initializing user interface...

***************************************************************************
** Error: Line 59: The class "IconLoader.ICON_APP" is undefined.
** Perhaps Java is not running.
** 
** Call stack:
** >gui_brainstorm.m>CreateWindow at 59
** >bst_call.m at 26
** >macro_methodcall.m at 37
** >gui_brainstorm.m at 32
** >gui_initialize.m at 30
** >bst_startup.m at 310
** >brainstorm.m at 118
** 
***************************************************************************


***************************************************************************
** Error: Line 34:  javaObjectEDT
** No class org.brainstorm.tree.BstTree can be located on the Java class path
** 
** Call stack:
** >java_create.m at 34
** >panel_protocols.m>CreatePanel at 52
** >bst_call.m at 26
** >macro_methodcall.m at 37
** >panel_protocols.m at 43
** >gui_show.m at 68
** >gui_initialize.m at 34
** >bst_startup.m at 310
** >brainstorm.m at 118
** 
***************************************************************************

I had not knowingly installed any system updates (I have disabled all automatic updates as well), or any updates to MATLAB, MATLAB toolboxes, or Java. In short, I am unsure what could have caused this issue to suddenly arise.

My Java is a bit rusty, but it appears that Matlab is treating IconLoader as a package and ICON_APP as a class, when in fact IconLoader is a class and ICON_APP is an instance of a swing ImageIcon class. Perhaps this is not an issue with Brainstorm at all, but an issue with how Matlab is resolving java components. Especially since Matlab claims to be unable to locate org.brainstorm.tree.BstTree, which is right where one would expect it to be in the brainstorm JAR: brainstorm3/java/brainstorm.jar/org/brainstorm/tree/BstTree.class[/.java].

Thanks,
Graham

Hi Graham,

  1. Are you running Matlab with the full desktop environment?
    Brainstorm cannot run if you use the -nodesktop or -nojvm options.

  2. Have you restarted Matlab after updating Brainstorm?
    Matlab cannot unload a class and reload a new different one after, so if some elements in the compiled Java part of Brainstorm changed, it will not work.

  3. What version of Matlab are you using?
    The problem cannot be your system Java install, as Matlab only uses its own bundled JVM (type “ver” in the command window to check its version).
    Have you been running Brainstorm previously on the same computer?

Cheers,
Francois

Hi Francois,

Thanks for the quick reply.

  1. Yes, I am using the full desktop environment.

  2. I have restarted Matlab after updating Brainstorm, and it had no effect.

  3. I am using Matlab version 8.5.0.197613 (R2015a), Java version 1.7.0_60-b19. I have been running Brainstorm previously on this computer.

Thanks,
Graham

For some reason, your Matlab doesn’t let you add the “brainstorm.jar” to you Java classpath.

This can be tested with just two lines:

javaaddpath('/...installationpath.../brainstorm3/java/brainstorm.jar');
org.brainstorm.icon.IconLoader.ICON_APP

Typing this in your Matlab command window should return:

jar:file:/...installationpath.../brainstorm3/java/brainstorm.jar!/org/brainstorm/icon/bstico.png

If you can’t figure out why this is not working, you can check with the Mathworks support, maybe they can give you an indication about what is wrong with your current setup.

Francois

Matlab at least claims that it is adding these jars to the Java classpath:


>> javaclasspath

                STATIC JAVA PATH

        /usr/local/MATLAB/R2015a/java...
       ...

		DYNAMIC JAVA PATH
       
	/home/graham/Code/MATLAB/brainstorm3/java/brainstorm.jar      
	...

And yet…


>> org.brainstorm.icon.IconLoader.ICON_APP
Undefined variable "org" or function "org.brainstorm.icon.IconLoader.ICON_APP".

I will take this to Mathworks and see if they can offer any insight.

Thanks,
Graham

FWIW, this issue was finally resolved after a couple weeks of back-and-forth with MathWorks. Another toolbox in my default environment quietly installed an auto-update, shadowing a MATLAB builtin in the process. Some MATLAB code which should have called the “builtin” function did not, and so was accidentally calling the overloaded function. This led (very indirectly) to problems managing the Java classpath.

Hi Graham,

I am having the same issue. How exactly did you sort it out?

Thank you!

Ramtin