0

While testing software download with Java example package version 7.41, I found it to be failing with "MalformedURLException: no protocol" in JavaSoftwareDriver.download(...)

While investigating further with debugger, I found out that toBeInstalledEntry contains key 'testfile' and value '1.0.0', and neither of these make much sense as URL. Is this example just plain broken, or could it be version conflict between server and agent ? Class "Software" used by the class appears to be deprecated, but I could not find any information or replacement to it.

Hannu_H
  • 5
  • 1

1 Answers1

0

The software management in the example agent is not fully working. The problem is that on start it updates its software list in Cumulocity with all the jar files contained in the agent. When you try to do an update to this it will try to download all these jars but as they are not stored as a real URL it breaks.

If you check the JavaSoftwareDriver of the agent you can remove the code of the initialize(). This is what loads the jars. Afterwards you also need to remove the jar listings in Cumulocity from the device and then you can still use this way of software management but you need to save the software in Cumulocity with the url also in the version field.

Instead of the "Software" class the recommend way of software management is SoftwareList described here http://cumulocity.com/guides/reference/device-management/. There is also a class for that in the device-capability-model. This also includes the possibility to upload the software binaries to Cumulocity and the device can download it from there.

TyrManuZ
  • 2,039
  • 1
  • 14
  • 23
  • "..save the software in Cumulocity with the url also in the version field" Where do I obtain the URL ? Browser gives something like https://.cumulocity.com/62dd47d0-a999-4b04-97a0-58aaa3ae5549, but that doesn't contain the desired file. Actually that's even preceeded by "blob:" but that again fails with URL exception – Hannu_H Jan 27 '17 at 12:52
  • On easy way to find the correct URL is to go to the software repository, open the developer console and then download the repository. From the developer console you can see the correct URL. Something like this: https://.cumulocity.com/inventory/binaries/ This is also the URL that is send to the device when you create an operation to update software for example – TyrManuZ Feb 09 '17 at 16:36