OSGi Service comsumer and provider

53 views
Skip to first unread message

Lukas Heidbreder

unread,
Dec 7, 2023, 4:46:26 AM12/7/23
to iDempiere
Hello, everyone.
I've run into the following issue and I hope, someone here is more knowledgable than me.

For a plugin I am trying to rewrite, I intend to implement OSGi service behavior. Having had a look at core code, I tried a few ways of recreating the behavior here:

However, when I run the code, the provider will never be found. Now, am I doing something wrong, do I have to do something special in iDempiere environments or is it straight up impossible from plugins?

Thanks in advance

Orlando Curieles

unread,
Dec 7, 2023, 5:39:15 AM12/7/23
to idem...@googlegroups.com
Hi, can you show me the code ??

Regards

 Orlando

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/ee0e67e4-8a92-466a-bd93-3b96d5c1df99n%40googlegroups.com.

Lukas Heidbreder

unread,
Dec 7, 2023, 5:53:11 AM12/7/23
to iDempiere

Heng Sin Low

unread,
Dec 7, 2023, 6:25:00 AM12/7/23
to idem...@googlegroups.com
That looks pretty straightforward, make sure the plugin hosting the provider have been activated and service is available. You can check that at the osgi console.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Heng Sin Low

unread,
Dec 7, 2023, 6:29:56 AM12/7/23
to idem...@googlegroups.com
Btw, to look up OSGi service, you should use org.adempiere.base.Service instead of java.util.ServiceLoader.

It seems the xml configuration file is missing for CupsProvImpl. If you are using @Component annotation, you need to enable Window > Preferences > Plug-in Development > DS Annotations > Generate descriptor from annotated sources.

Orlando Curieles

unread,
Dec 7, 2023, 6:39:06 AM12/7/23
to idem...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages