Web figures fail to render properly on headless server

I've developed an application which displays some charts via Web Figures. The server logic is in Java, on a Glassfish server; the MATLAB version is R2010b and is compiled with MATLAB Builder JA. The operating system is OpenSUSE Gnu/Linux.
The problem is this: When I launch the server from an X environment, everything works correctly. However, if I launch the server from console, strings fail to render. The server log contains the (rather unhelpful) error:
In [..]/MATLAB/R2010b/toolbox/compiler/mcr/matlab/graphics/hardcopy.p>hardcopy at 21 In compiler/private/hardcopyOutput at 58 In renderwebfigure>cropFigureAndReturnCData at 84 In renderwebfigure at 32 Warning: Failed to draw text string
Right now we're in demo mode, and starting from X is a workaround, but it's obviously not acceptable for a production server to need somebody to graphically log into the machine and launch it manually. How can I avoid this need to run from X?

2 Comments

Daniel: Please contact Tech Support if you are unable to find an answer to your question on this forum.
I am having a very similar problem and haven't been able to get through to Tech Support this afternoon. Was this problem resolved?
I ultimately want to kick off nightly matlab runs on an HPCS so I am using matlab -nodisplay -nosplash -r scriptfilename
For test cases I am running with -nodisplay on a SunOS, sample code:
hndl=figure;
set(hndl,'visible','off');
aviFileName='test.avi';
mov=avifile(aviFileName,'FPS',10,'COMPRESSION','NONE','Quality',100,'KeyFrame',10);
title('Hello World');
F=im2frame(hardcopy(hndl,-Dzbuffer','-r0'));
I get Warning: Failed to draw text string

Sign in to comment.

Answers (0)

Categories

Asked:

on 15 Jun 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!