Version: unspecified (using KDE 4.5.5) OS: Linux Umbrello cannot be run on a headless machine to export diagrams because it appears that it needs the X server, even in the absence of the GUI. I've observed this happening when shelling into another machine and running the following command remotely. Reproducible: Didn't try Steps to Reproduce: $ umbrello --export svg Project.xmi Actual Results: umbrello: cannot connect to X server Expected Results: Expected to export diagrams. Using Umbrello UML Modeller: 2.4.5-r1254891.
(In reply to comment #0) > Version: unspecified (using KDE 4.5.5) > OS: Linux > > Umbrello cannot be run on a headless machine to export diagrams because it > appears that it needs the X server, even in the absence of the GUI. I've > observed this happening when shelling into another machine and running the > following command remotely. > > Reproducible: Didn't try > > Steps to Reproduce: > $ umbrello --export svg Project.xmi > > Actual Results: > umbrello: cannot connect to X server > At a first look there as some obvious reasons for this: 1. in main.cpp KApplication is created always with Gui enabled - this is easy to fix 2. UMLApp uses several objects like the QPrinter object, which creates a QWidget object. It looks they depend on an X-Server. The question is if it is possible to avoid such object creations or if not if it is possible to use some memory based gui output device to avoid the x-server dependency.
(In reply to comment #1) > (In reply to comment #0) > > Version: unspecified (using KDE 4.5.5) > > OS: Linux > > > > Umbrello cannot be run on a headless machine to export diagrams because it > > appears that it needs the X server, even in the absence of the GUI. I've > > observed this happening when shelling into another machine and running the > > following command remotely. > > > > Reproducible: Didn't try > > > > Steps to Reproduce: > > $ umbrello --export svg Project.xmi > > > > Actual Results: > > umbrello: cannot connect to X server > > > At a first look there as some obvious reasons for this: > 1. in main.cpp KApplication is created always with Gui enabled - this is > easy to fix > 2. UMLApp uses several objects like the QPrinter object, which creates a > QWidget object. It looks they depend on an X-Server. The question is if it > is possible to avoid such object creations or if not if it is possible to > use some memory based gui output device to avoid the x-server dependency. At a second look: UMLApp depends on KXmlGuiWindow, which initialisation raises an error 'QWidget: Cannot create a QWidget when no GUI is being used' in the constructor UMLApp::UMLApp(QWidget* parent) -> : KXmlGuiWindow(parent), which initialisation : KXmlGuiWindow(parent),
It looks like it is probably possible to run it headless, but it would mean re-factoring potentially some code - which could be difficult.
(In reply to comment #2) > (In reply to comment #1) > > (In reply to comment #0) > > > Version: unspecified (using KDE 4.5.5) > > > OS: Linux > > > > > > Umbrello cannot be run on a headless machine to export diagrams because it > > > appears that it needs the X server, even in the absence of the GUI. I've > > > observed this happening when shelling into another machine and running the > > > following command remotely. > > > > > > Reproducible: Didn't try > > > > > > Steps to Reproduce: > > > $ umbrello --export svg Project.xmi > > > > > > Actual Results: > > > umbrello: cannot connect to X server > > > > > At a first look there as some obvious reasons for this: > > 1. in main.cpp KApplication is created always with Gui enabled - this is > > easy to fix > > 2. UMLApp uses several objects like the QPrinter object, which creates a > > QWidget object. It looks they depend on an X-Server. The question is if it > > is possible to avoid such object creations or if not if it is possible to > > use some memory based gui output device to avoid the x-server dependency. > > At a second look: UMLApp depends on KXmlGuiWindow, which initialisation > raises an error 'QWidget: Cannot create a QWidget when no GUI is being > used' in the constructor The message comes from void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) { Q_Q(QWidget); if (QApplication::type() == QApplication::Tty) qFatal("QWidget: Cannot create a QWidget when no GUI is being used"); which means using KApplication/QApplication without GUI enabled will not work. > if it is possible to use some memory based gui output device to avoid the x-server dependency. The answer to this is Xvfb - http://en.wikipedia.org/wiki/Xvfb Xvfb :1 >/dev/null 2>&1 & DISPLAY=:1 umbrello --export-formats bmp bw dot eps epsf epsi ico jp2 jpeg jpg pcx pic png ppm rgb rgba sgi svg tga tif tiff xbm xpm xv
(In reply to comment #4) > DISPLAY=:1 umbrello --export-formats There is one problem with --export-formats: it prints out to stderr, which makes it impossible to separate export formats from the debug output.
SVN commit 1285525 by habacker: Use stdout as output channel for --export-formats. Without it is not possible to separate requested informations from debug output. M +1 -1 main.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1285525
SVN commit 1285526 by habacker: We do not need the gui for --export-format command line option. M +1 -1 main.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1285526
Hey Ralf. I just updated to svn head (2.4.5-r1285581), rebuilt, and installed. This is what I observed: $ umbrello --export-formats umbrello: cannot connect to X server $ umbrello --export svg Project.xmi umbrello: cannot connect to X server
Yes, as already mentioned in this thread: umbrello on linux/unix is not able to run without a display. You can use xvfb, which is part of xorg-x11-server or Xvnc to prodive a virtual display without any real output.
It would be good to add an additional faq entry on http://uml.sourceforge.net/faq.php. Is anyone there, who can do it ?
Hey Ralph. I guess we have two options. One is to explore what would be required to get Umbrello to run headless on its own. The second is to use through xvfb. I don't know anything about xvfb, but otherwise I would modify the FAQ myself to cover that.
*** Bug 130601 has been marked as a duplicate of this bug. ***
umbrello faq entry has been updated http://userbase.kde.org/Umbrello/FAQ#Can_I_use_Umbrello_command_line_features_without_an_X_server_.3F
Thanks a lot Ralph. Always a pleasure to work with you.