我在远程安装部署包时遇到了问题,下面是我在请求主题- $EDC/amir-kura/test-client/DEPLOY-V2/EXEC/download上发送的指标
job.id=12345678910L
dp.uri=file:/home/amir/Downloads/org.eclipse.kura.example.hello_osgi/resources/dp/hello_osgi.dp
dp.name=hello_osgi
dp.version=1.0.0
dp.download.protocol=HTTPS
dp.install.system.update=false当我收到关于Notify主题-$EDC/amir-kura/new-client/DEPLOY-V2/NOTIFY/test-client/download的以下答复时,该包被成功下载
{dp.download.size=0,
dp.download.progress=100,
dp.download.status=COMPLETED,
job.id=12345678910,
client.id=test-client}但是安装失败了。下面是我的库拉控制台-
15:06:07,357 [MQTT Call: test-client] INFO CloudServiceImpl:440 - Message arrived on topic: $EDC/amir-kura/test-client/DEPLOY-V2/EXEC/download
15:06:07,382 [pool-2-thread-2] INFO CloudDeploymentHandlerV2:459 - About to download and install package at URL file:/home/amir/Downloads/org.eclipse.kura.example.hello_osgi/resources/dp/hello_osgi.dp
15:06:07,382 [pool-2-thread-2] INFO CloudDeploymentHandlerV2:468 - Downloading package from URL: file:/home/amir/Downloads/org.eclipse.kura.example.hello_osgi/resources/dp/hello_osgi.dp
15:06:07,387 [pool-12-thread-1] INFO DataServiceImpl:441 - Storing message on topic :$EDC/#account-name/new-client/DEPLOY-V2/NOTIFY/test-client/download, priority: 1
15:06:07,389 [pool-12-thread-1] INFO DataServiceImpl:444 - Stored message on topic :$EDC/#account-name/new-client/DEPLOY-V2/NOTIFY/test-client/download, priority: 1
15:06:07,402 [DataServiceImpl:Submit] INFO MqttDataTransport:512 - Publishing message on topic: $EDC/amir-kura/new-client/DEPLOY-V2/NOTIFY/test-client/download with QoS: 1
15:06:07,403 [pool-12-thread-1] INFO DownloadImpl:131 - Ready to install
15:06:07,405 [pool-2-thread-2] INFO DataServiceImpl:441 - Storing message on topic :$EDC/#account-name/new-client/DEPLOY-V2/REPLY/REQUEST_M2UIS65D0O7DFILVRH9QF80QKE, priority: 1
15:06:07,423 [pool-2-thread-2] INFO DataServiceImpl:444 - Stored message on topic :$EDC/#account-name/new-client/DEPLOY-V2/REPLY/REQUEST_M2UIS65D0O7DFILVRH9QF80QKE, priority: 1
15:06:07,430 [DataServiceImpl:Submit] INFO MqttDataTransport:512 - Publishing message on topic: $EDC/amir-kura/new-client/DEPLOY-V2/REPLY/REQUEST_M2UIS65D0O7DFILVRH9QF80QKE with QoS: 0
!SESSION 2017-05-16 14:51:45.651 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN
Command-line arguments: -dev file:/home/amir/eclipse/workspaces/kura/.metadata/.plugins/org.eclipse.pde.core/Kura_Emulator_Linux/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -console
!ENTRY org.apache.felix.deploymentadmin 4 0 2017-05-16 15:06:07.499
!MESSAGE Stream does not contain a valid deployment package: missing manifest!
15:06:07,500 [pool-12-thread-1] INFO InstallImpl:135 - Install failed!
15:06:07,509 [pool-12-thread-1] INFO DataServiceImpl:441 - Storing message on topic :$EDC/#account-name/new-client/DEPLOY-V2/NOTIFY/test-client/install, priority: 1
15:06:07,535 [pool-12-thread-1] INFO DataServiceImpl:444 - Stored message on topic :$EDC/#account-name/new-client/DEPLOY-V2/NOTIFY/test-client/install, priority: 1
15:06:07,550 [DataServiceImpl:Submit] INFO MqttDataTransport:512 - Publishing message on topic: $EDC/amir-kura/new-client/DEPLOY-V2/NOTIFY/test-client/install with QoS: 1
15:06:07,684 [MQTT Call: test-client] INFO DataServiceImpl:376 - Confirmed message ID: 1348 to store
15:06:07,935 [MQTT Call: test-client] INFO DataServiceImpl:376 - Confirmed message ID: 1350 to store根据错误,我发送了一个无效的部署包,因为它缺少Manifest,但是我已经创建了Hello示例中提到的.dp文件。
我该怎么解决这个问题?似乎没有其他人遇到过这个问题
发布于 2017-05-19 07:30:05
我在@Amir评论之后添加了第二个答案。另一个答案并不涉及实际问题,但在其他一些情况下可能会有所帮助。
我认为问题在于发送到DEPLOY-V2 cloudlet的度量标准。
dp.uri=file:/home/amir/Downloads/org.eclipse.kura.example.hello_osgi/resources/dp/hello_osgi.dp
dp.download.protocol=HTTPS在通知中也有这样的指示:
dp.download.size=0URI说它是本地文件系统上的一个文件,但是协议说要使用HTTPS。
如果你看部署-V2文档,你会读到
Kura 1.4.0引入了一个名为“Deploy-V2”的部署应用程序的新版本。引入的主要特性与包分发的另一种方法有关:而不是在MQTT消息中接收包,设备只接收包含通过HTTP执行独立下载所需的所有信息的下载请求。 dp.uri (String)强制性的。表示部署包的URI。dp.download.protocol (字符串)是强制性的。指定用于下载包/shell脚本的协议。必须设置为HTTP或HTTPS。
您需要提供一个有效的HTTP来下载DP。
发布于 2017-05-17 07:14:17
在构建部署包时,需要注意两件事。
舱单作为第一项
MANIFEST.MF文件包含在META-INF/目录中。按照ZIP标准,您可以在文件中添加一个条目以创建目录,并在文件中添加第二个条目。这是DP格式中不支持的,因此必须直接添加带有完整路径的文件,作为生成的DP文件中的第一个条目。
例如,使用maven-antrun-plugin打包DP,您可以对<jar>命令使用filesonly="true"属性:
<jar destfile="${basedir}/../you.final.dp_1.0.0.dp"
manifest="${project.build.directory}/dp_stage/META-INF/MANIFEST.MF"
includes="" filesonly="true">
<filelist dir="${project.build.directory}/dp_stage/" files="${sortedFiles}"/>
</jar>束序
如果您的部署包包含多个包,则它们必须按照与相同的顺序包含。您可以使用字母顺序,这是可预测的,并且运行良好:-)
将您的JAR复制到文件夹中,并以排序方式将它们添加到DP中。使用相同的maven-antrun-plugin
<copy file="${basedir}/../project/target/first.bundle_1.0.0.jar"
todir="${project.build.directory}/dp_stage/bundles/" />
<copy file="${basedir}/../project2/target/second.bundle_1.0.0.jar"
todir="${project.build.directory}/dp_stage/bundles/" />
<!-- Files MUST be included in the jar in the same order as they are declared in the DP MANIFEST.
I used alphabetical order. -->
<!-- https://ant.apache.org/manual/Tasks/jar.html -->
<local name="sortedFiles"/>
<pathconvert property="sortedFiles" pathsep="${line.separator}">
<sort>
<fileset dir="${project.build.directory}/dp_stage/" includes="bundles/*"/>
</sort>
</pathconvert>我在github上有一个个人项目,它就是这样做的,请看一下参考资料。
https://stackoverflow.com/questions/43999337
复制相似问题