技术文章 - CS316161

Azure IoT Hub 连接器 3.0 在连接到 ThingWorx Platform 8.5 时显示“缺少应用程序密钥”和“配置文件中的路由组不能为空”错误

已修改: 17-Jan-2023   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • ThingWorx Platform 8.5
  • Azure IoT Hub Connector 3.0

说明

  • 无法将Azure IoT 中心连接器连接到 ThingWorx Platform
  • Azure IoT 中心连接器未按预期连接到连接服务器
  • 无法使用Azure IoT 中心连接器连接到平台
  • 应用程序密钥错误似乎指向Azure IoT 中心连接器使用的应用程序密钥不正确,但事实并非如此
  • Azure IoT 中心连接器CLI 输出显示如下:
    • <日期时间> 错误重新填充连接 [通道:null,端点 <ws 或 wss>://<ThingWorx 主机>:<端口>/Thingworx/WS,uri:<ws 或 wss>://<ThingWorx 主机> :<端口>/Thingworx/WS] 失败:com.thingworx.sdk.api.exception.AuthenticationException:连接身份验证/注册失败 [通道:NettyBytesChannel [id=<ws 或 wss>://<ThingWorx 主机>:<端口>/Thingworx/WS-5,closed=false],代码:STATUS_UNAUTHORIZED,原因:错误[上下文:验证连接][原因:缺少应用程序密钥!]]
      java.util.concurrent.CompletionException:com.thingworx.sdk.api.exception.AuthenticationException:连接身份验证/注册失败 [通道:NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx /WS-5,closed=false],代码:STATUS_UNAUTHORIZED,原因:错误[上下文:验证连接][原因:缺少应用程序密钥!]]
      在 java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
      在 java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
      在 java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
      在 java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)
      在 java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
      在 java.util.concurrent.CompletableFuture.completeExceptionally (CompletableFuture.java:1977)

      ...
      由以下原因引起:com.thingworx.sdk.api.exception.AuthenticationException:连接身份验证/注册失败 [通道:NettyBytesChannel [id=<ws or wss>://<ThingWorx Host>:<Port>/Thingworx/WS-5, closed=false],代码:STATUS_UNAUTHORIZED,原因:错误[上下文:验证连接][原因:缺少应用程序密钥!]]
      ...省略了 45 个公共框架
      ...
      <日期时间> 错误无法启动 ConnectionServer
      com.google.inject.CreationException:无法创建注入器,请参阅以下错误:

      1)构造函数注入错误,java.lang.RuntimeException: routing-group in configuration file cannot be blank
      在 com.thingworx.protocol.azure.iot.AzureIotHubBindService.<init>(AzureIotHubBindService.java:41)
      在 com.thingworx.protocol.azure.iot.AzureIotGuiceModule.configure(AzureIotGuiceModule.java:34)
      在定位 com.thingworx.protocol.azure.iot.AzureIotHubBindService 时
      对于 com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.<init>(AzureIotProtocolAdapter.java:94) 的第 6 个参数
      在定位 com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter 时
      在定位 com.thingworx.connectionserver.protocol.Protocol 时
      对于 com.thingworx.connectionserver.ConnectionServerDataPlane.<init>(ConnectionServerDataPlane.java:47) 的第 9 个参数
      ...
  • <ThingworxStorage>\logs\ApplicationLog.log在与 Azure IoT Hub Connector 连接时显示以下内容
    • <日期时间> [L: 错误] [O: ctcpmDispatchingServerCommunicationModule] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] 缺少应用程序密钥!
      <日期时间> [L: ERROR] [O: ctcscjJsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] 错误 [正在验证连接], 服务器 websocket 将被关闭。原因:缺少应用程序密钥!
      <日期时间> [L: INFO] [O: ctcscjJsr356ServerConnection] [I: ] [U: ???] [S: ] [P: ] [T: http-nio-8080-exec-3] 服务器 WebSocket 正在关闭并且已经从服务器端点注销 [ws session id: 26] CloseReason: code [1011], reason [Error [authenticating connection], Server websocket will be closed.]
这是文章 316161 的 PDF 版本,可能已过期。最新版本 CS316161