Search code examples
javaxmljaxbdockergconf

Running JAXB/XJC in Dockerfile yields in GConf Error


I'm using docker in combination with a Java project that is compiled during the build process. Now I'm trying to generate Java code based on Collada XML schema version 1.5 by calling following shell script inside the Dockerfile:

BASEDIR=$(dirname $0)
xjc $BASEDIR/schema/collada/collada-schema-1.5.xsd \
    -d $BASEDIR/knowrob_vis/src/main/java \
    -p org.knowrob.vis.collada \
    -extension $BASEDIR/schema/simpleMode.xsd

Unfortunately, this yields in following error:

(process:4093): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
GConf Error: No D-BUS daemon running

On my host machine it works fine to generate the Java code. You can find the Dockerfile here: https://raw.githubusercontent.com/knowrob/docker/master/hydro-knowrob/hydro-knowrob-daemon_local/Dockerfile

EDIT1: It seems xjc has some strange XServer dependencies. That does not make sense to me. Howto avoid that problem?


Solution

  • I solved the issue. In fact the DBus error can be ignored.

    The problem was having no write permissions on the directory where xjc tries to generate the files. Fixed it by switching ownership to user that is used in the Dockerfile.