Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » How to reference to user's created plug-in project from new package?
How to reference to user's created plug-in project from new package? [message #1749252] Sun, 04 December 2016 14:16 Go to next message
Abel Gr is currently offline Abel GrFriend
Messages: 13
Registered: January 2016
Junior Member
I create one package with name org.azure.senddata.

It I deploy and install on Kura, It work very OK.

But if I want to call it from new package, create a org.azure.senddata object.

It can't resolve this class.

My way is I add it in to auto depedencies, it exist. But I can "Add depences" package.

Please help me to make it work.

Thanks a lot.

Gr
Re: How to reference to user's created plug-in project from new package? [message #1749449 is a reply to message #1749252] Tue, 06 December 2016 21:58 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

Are you exporting the org.azure.senddata package in your first bundle's Manifest? You will also need to import org.azure.senddata in your second bundle's Manifest.

Thanks,
--Dave
Re: How to reference to user's created plug-in project from new package? [message #1749731 is a reply to message #1749449] Sat, 10 December 2016 12:33 Go to previous messageGo to next message
Abel Gr is currently offline Abel GrFriend
Messages: 13
Registered: January 2016
Junior Member
Hi Dave,

Sorry for late reply. I have to go to hospital for some days for my health.

Back about my issue, can you give me more explainations or little detail.

For simplyfi to discuss, here is that I'm having:

1) Bundles org.azure.senddata: to connect azure cloud and send data to Azure IoT Hub. This Bundles work well, no problem or issue.
2) Bundles org.kura.example.smartair: This new bundles that I writting. And I want to calll some methods from org.azure.senddata to send data to azure cloud.

But I can't resolve org.azure.senddata in org.kura.example.smartair. Please show me how to do that?

Thank a lot,

Gr
Re: How to reference to user's created plug-in project from new package? [message #1749929 is a reply to message #1749731] Wed, 14 December 2016 01:55 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

Packages are not available by default across OSGi bundles. This is an important feature of the modularity of OSGi. In order to use a package from Bundle A inside Bundle B, Bundle A must "export" the package and Bundle B must "import" the package. This is all done through the bundle's MANIFEST.MF file. So, whichever package in the org.azure.senddata bundle that has the methods you need will need to be exported. Your org.kura.example.smartair bundle will then need to import that package. For example, the API bundle in Kura (org.eclipse.kura.api) exports a large number of packages for other bundles to use. The manifest for the API bundle is here [1]. You can view any of the Kura examples for how to use the import statement, but here is one example [2].

I hope this helps.

[1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.api/META-INF/MANIFEST.MF
[2] https://github.com/eclipse/kura/blob/develop/kura/examples/org.eclipse.kura.demo.heater/META-INF/MANIFEST.MF

Thanks,
--Dave
Previous Topic:multiple devices connected by modbus
Next Topic:Connecting one device by modbus
Goto Forum:
  


Current Time: Tue Apr 23 11:30:06 GMT 2024

Powered by FUDForum. Page generated in 0.03411 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top