Web figures fail to render properly on headless server
Show older comments
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
Kaustubha Govind
on 16 Jun 2011
Daniel: Please contact Tech Support if you are unable to find an answer to your question on this forum.
Pei
on 4 Jan 2012
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
Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!