Error launching bst without display

Hello,

I’m the sys admin of a cluster and one of our user wants to use brainstorm on it.
We have matlab 2013b and bst 140929.

I have tried to launch matlab without display and

cd brainstorm3
brainstorm nogui

Here is the error message:

BST> Starting Brainstorm:
BST> =================================
Error using java_create (line 36)
Java exception occurred:
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(Unknown Source)
at javax.swing.SwingUtilities.getSharedOwnerFrame(Unknown Source)
at javax.swing.JDialog.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mathworks.jmi.AWTUtilities$Invoker$4$1.call(AWTUtilities.java:502)
at com.mathworks.mvm.context.ThreadContext.callWithContext(ThreadContext.java:105)
at com.mathworks.mvm.context.MvmContext.callWithContext(MvmContext.java:113)
at com.mathworks.jmi.AWTUtilities$Invoker$4.runWithOutput(AWTUtilities.java:499)
at com.mathworks.jmi.AWTUtilities$Invoker$2.watchedRun(AWTUtilities.java:415)
at com.mathworks.jmi.AWTUtilities$WatchedRunnable.run(AWTUtilities.java:376)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Error in bst_splash (line 40)
jSplash = java_create(‘javax.swing.JDialog’, ‘Ljava.awt.Frame;Ljava.lang.String;Z’, [], ‘Brainstorm 3.2’, 0);
Error in bst_startup (line 84)
bst_splash(‘show’);
Error in brainstorm (line 119)
bst_startup(BrainstormHomeDir, 0);

Any clue?

Thanks

Hello

The startup option “brainstorm nogui” starts the software with the main interface window hidden, but it still requires the JVM running in the background.
It will not work with the options “matlab -nojvm” or “matlab -nodesktop”.

Additional developments for running Brainstorm scripts in Java-free environments are planned but will not start within the next months.
I already had this request a few times, to run scripts on distant clusters, so I know it is an important thing to add.

Sorry for the bad news.
Francois

Thanks for your reply.

In fact I’m not quit sure I understand the reason. On the nodes, I have java installed, so it’s not a problem to launch something that requires java, unless it requires a display.

Is there a way to start the jvm in headless mode or I’m out of luck and the only way is to wait for a new revision of the soft?

Thanks

I’m sorry, I guess most of the software would not run in headless mode.
All the program was initially been written to be based on its interface. It’s only recently that the scripting interface became flexible enough to be used remotely.
The main Java frame has to be instantiated and positioned on a display, even if it is never set as “visible” on that display.

You can try commenting out all the calls that cause this “HeadlessException” to be thrown and see if you can get to run, but it will probably involve some major rewriting.
Another option would be to identify what is the causing this exception and add a fake display/keyboard/mouse… Maybe there are easy ways to do that in Java.

I would be interested in finding a solution to this problem, as more and more people are going to have this same problem.
I don’t have a lot of time to dedicate to major developments now, but maybe it is something easy to do.