Comments (3)
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.
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.
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)
- dbus-java's Maven site is difficult to discover
- Emit meaningful error message instead of IndexOutOfBoundsException when demarshalling FileDescriptor without prerequisites satisfied HOT 5
- DBusSignal constructor is package private HOT 1
- Kotlin Interface does not work HOT 3
- NPE in org.freedesktop.dbus.connections.AbstractConnection.internalDisconnect(IOException) prevents JVM shutdown HOT 4
- Documentation example does not work correctly. HOT 1
- In version 5, `withAutoConnect(false)` appears broken. HOT 2
- Cleanup AbstractConnection
- `default` interface methods. Or not. HOT 7
- problem to execute DBusViewer HOT 3
- How to export/publish Property in interface? HOT 2
- Properties Get method endless waiting HOT 1
- Cannot connect to DBUS HOT 11
- Sending signal with byte[] fails with verbose logging HOT 1
- [Feature request] Any plan in adding a module-info ? HOT 2
- Custom ITransportProvider cannot be found by ServiceLoader HOT 4
- Something a bit wrong with `@DBusBoundProperty` HOT 9
- Incorrect code generation for systemd StartTransientUnit HOT 3
- Add dbus-java-transport-junixsocket to dbus-java-bom
- Help with DBusConnectionBuilder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbus-java.