libdbus-java - CreateInterface завершается с ошибкой [Fatal Error] introspect.dtd: 1: 3:

Я хочу написать служебный сценарий с groovy , который будет использовать dbus. Согласно документации на CreateInterface следующая команда должна сгенерировать исходный файл java для подходящего объекта.

CreateInterface --session  org.freedesktop.Notifications /org/freedesktop/Notifications

Но независимо от того, какой интерфейс я выберу, чтобы попытаться сгенерировать исходный файл, команда не работает с

> [Fatal Error] introspect.dtd:1:3: The markup declarations contained or pointed to by the document type declaration must be well-formed.
Exception in thread "main" org.xml.sax.SAXParseExceptionpublicId: -//freedesktop//DTD D-BUS Object Introspection 1.0//EN; systemId: http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd; lineNumber: 1; columnNumber: 3; The markup declarations contained or pointed to by the document type declaration must be well-formed.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at org.freedesktop.dbus.bin.CreateInterface.createInterface(CreateInterface.java:702)
    at org.freedesktop.dbus.bin.CreateInterface.main(CreateInterface.java:685)

Это происходит 16.04 и 16.10. Я не пробовал другие версии Ubuntu. Кто-нибудь знает, сломана ли эта утилита или я что-то делаю не так?

0
задан 15 February 2017 в 10:16

1 ответ

Просто выполните следующее:

gdbus introspect --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --xml | sed -e '/DOCTYPE/d' -e '/introspect.dtd/d' > org.freedesktop.Notifications.xml
CreateInterface --system --create-files org.freedesktop.Notifications.xml
0
ответ дан 27 September 2019 в 11:44

Другие вопросы по тегам:

Похожие вопросы: