Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Wrong Deployment Package URL sent by DeploymentAgentService(DeploymentAgent seems to post the wrong URL when launching on eclipse)
Wrong Deployment Package URL sent by DeploymentAgentService [message #1793949] Tue, 21 August 2018 04:13 Go to next message
Aistis K is currently offline Aistis KFriend
Messages: 4
Registered: March 2018
Junior Member
Hello.

I'm currently writing a module that tracks when a Deployment Package is installed, so i subscribe to the
DeploymentAgentService.EVENT_INSTALLED_TOPIC
event topic. When i run this module on eclipse kura emulator and try to install a deployment package, i get a URL that points to
/tmp/deploymentpackage.dp
, which is wrong, because the deployment package is actually in
 /tmp/kura/packages/deploymentpackage.dp
. After the deployment package being already installed and me running the kura emulator again, it gives the correct URL.

Is this an eclipse issue, or is there something i'm not understanding here?

[Updated on: Tue, 21 August 2018 04:15]

Report message to a moderator

Re: Wrong Deployment Package URL sent by DeploymentAgentService [message #1794137 is a reply to message #1793949] Fri, 24 August 2018 08:44 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 279
Registered: July 2015
Location: Italy
Senior Member
Hi,
a deployment package is first loaded into the /tmp area from where it is first installed using the deployment admin.
If the installation succeeds, then the dp file is moved to the specific kura/packages folder and from there installed at every reboot.

That is the reason of the two different URLs you are seeing.

You can take a look at the code here: https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.deployment.agent/src/main/java/org/eclipse/kura/deployment/agent/impl/DeploymentAgent.java#L455

Best regards,
Matteo
Re: Wrong Deployment Package URL sent by DeploymentAgentService [message #1794247 is a reply to message #1794137] Tue, 28 August 2018 04:07 Go to previous messageGo to next message
Aistis K is currently offline Aistis KFriend
Messages: 4
Registered: March 2018
Junior Member
Hi.

Thanks for the answer. So how do i get the correct path of the dp package, since when i run the code in eclipse (have not tried it on a dedicated osgi runtime) and catch the install event, the file is already in it's final path. What i want to do, is get some additional meta information from the manifest file, but the event does not post the package final path, it only posts the temporary path. I get the final path after restarting eclipse, actually i then get it every time i restart it. Does it work the same way on an osgi runtime that's not running in kur simulation mode?
Re: Wrong Deployment Package URL sent by DeploymentAgentService [message #1794257 is a reply to message #1794247] Tue, 28 August 2018 07:32 Go to previous message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 279
Registered: July 2015
Location: Italy
Senior Member
Hi,
there is no difference in behaviour between the emulator and an end device. The code is simply the same.
What you can do is to explore the dpa.properties file, when you get the installation event, to get the path to the jars that will be installed at the next reboot.
But maybe you can leverage some OSGi apis to get manifest file information directly from the runtime. I remember that we used OSGi APIs, for example, to get component properties . To see if there are similar APIs for the manifest file.

Best regards,
Matteo
Previous Topic:Kura doesn't work properly on Raspberry Pi
Next Topic:How to import in Eclipse com.microsoft.azure.sdk.iot.device jar
Goto Forum:
  


Current Time: Mon Nov 19 18:02:08 GMT 2018

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

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

Back to the top