Giter VIP home page Giter VIP logo

Comments (3)

hypfvieh avatar hypfvieh commented on July 18, 2024

I can't help much here. I don't have any setup which uses wayland or pipewire.

I would start with investigating the available interfaces on the bus using d-feet or similar dbus-browser.
According to the python code there should be several bus objects (e.g. org.freedesktop.portal.Desktop) which you have to query.

After that, I would use the InterfaceCodeGenerator (part of dbus-java-utils) to create proper Java interfaces for those bus objects.
With these interfaces it should be possible to adapt the python sample to Java (maybe some trail and error is needed).

from dbus-java.

sblantipodi avatar sblantipodi commented on July 18, 2024

hi @hypfvieh
thank you very much for the answer, I appreciate it.

Is there a mailing list where we can discuss about these things? :) I don't know if the issue is the best place to do it and I don't want to bother here.

I am trying to generate the interfaces for org.freedesktop.portal.Desktop with this command:

mvn exec:java \
   -Dexec.mainClass="org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator" \
   -Dexec.executable="java" \
   -Dexec.args="--system --outputDir /tmp/classes org.freedesktop /org/freedesktop"	

but I have this error:

[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< com.github.hypfvieh:dbus-java-utils >-----------------
[INFO] Building dbus-java-utils 4.3.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:3.1.0:java (default-cli) @ dbus-java-utils ---
15:59:20.863 [org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator.main()] INFO  o.f.d.u.g.InterfaceCodeGenerator - Introspecting: { Interface: /org/freedesktop, Busname: org.freedesktop }
15:59:20.874 [org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator.main()] INFO  o.f.d.c.transports.TransportBuilder - Using transport dbus-java-transport-jnr-unixsocket for address unix:path=/var/run/dbus/system_bus_socket
15:59:20.945 [org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator.main()] ERROR o.f.d.u.g.InterfaceCodeGenerator - Failure in DBus Communications. 
org.freedesktop.dbus.errors.ServiceUnknown: The name org.freedesktop was not provided by any .service files
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
        at org.freedesktop.dbus.errors.Error.getException(Error.java:116)
        at org.freedesktop.dbus.errors.Error.throwException(Error.java:143)
        at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(RemoteInvocationHandler.java:206)
        at org.freedesktop.dbus.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:89)
        at jdk.proxy3/jdk.proxy3.$Proxy42.Introspect(Unknown Source)
        at org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator.main(InterfaceCodeGenerator.java:563)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:279)
        at java.base/java.lang.Thread.run(Thread.java:1623)

it works well if I generate the interfaces for org.bluez

from dbus-java.

hypfvieh avatar hypfvieh commented on July 18, 2024

There is no mailing list, forum etc. just this bugtracker - this project is too small for any additional communication platform (and I'm the only maintainer). Therefore it is completely fine to ask questions in the bug tracker.

You are using the wrong bus type and the wrong busname.
The org.freedesktop.portal.Desktop is only visible on the session bus (therefore you have to use --session instead of --system). Then you also have to specify the correct bus name which is org.freedesktop.portal.Desktop and the correct path /org/freedesktop/portal/desktop (as seen in d-feet).
Additionally I would add the "--all" flag to create any interface file (you don't know yet which you will need).

In the end the command line should look like this:

mvn exec:java -Dexec.mainClass="org.freedesktop.dbus.utils.generator.InterfaceCodeGenerator" -Dexec.executable="java" -Dexec.args="--all --session --outputDir /tmp/classes org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop"

from dbus-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.