技术文章 - CS316173
将 Azure IoT 中心连接器 3.0 连接到 ThingWorx Platform 8.5 时出现“无法从平台获取 Azure IoT 中心配置”
已修改: 17-Jan-2023
适用于
- ThingWorx Platform 8.5 to 9.1
- Azure IoT Hub Connector 3.0
说明
- 无法使 Azure Iot Hub 连接器与 ThingWorx Platform 一起使用
- 无法为 Thingworx 版本 8.5.1 启动 Azure IoT 中心连接器版本 V3.0.1。
- 由于ThingworxStorage/logs/SecurityLog.log中的 ssl 加密不匹配,IoT 中心连接器停止并在日志中显示以下错误:
- 没有为身份验证方案指定 authType 或 appKey 参数:AUTH_THINGWORX_APPKEY
- Azure 连接器因解密问题而无法连接到平台
- 已完成启动并运行 Azure IoT 中心连接器帮助中心中的“为 Azure IoT 中心凭据设置加密”部分,但连接器仍然失败
- 启动<Azure IoT Hub Connector>\connector\bin\azure-iot时,CLI 中仍然出现以下错误
- java.lang.IllegalStateException:无法从平台获取 Azure IoT 中心配置
在 com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.initialize(AzureIotProtocolAdapter.java:336)
在 com.thingworx.connectionserver.ConnectionServerDataPlane.initProtocol(ConnectionServerDataPlane.java:152)
在 com.thingworx.statemachine.DispatchingEventChannel.doEvent(DispatchingEventChannel.java:36)
在 com.thingworx.statemachine.AbstractEventChannel.apply(AbstractEventChannel.java:50)
在 rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
在 rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
在 rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:224)
在 rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
在 rx.internal.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:107)
在 java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)
在 java.util.concurrent.ThreadPoolExecutor$Worker.run(未知来源)
在 java.lang.Thread.run(未知来源)
原因:java.lang.Exception:解密安全字节时出错:给定的最终块未正确填充。如果在解密过程中使用了错误的密钥,就会出现此类问题。
在 com.thingworx.security.encryption.SecureBytes.cipherData(SecureBytes.java:184)
在 com.thingworx.security.encryption.SecureString.decrypt(SecureString.java:70)
在 com.thingworx.security.encryption.SecureString.decrypt(SecureString.java:55)
在 com.thingworx.protocol.azure.iot.util.SecurityUtils.decryptWithKey(SecurityUtils.java:20)
在 com.thingworx.protocol.azure.iot.AzureConfiguration.<init>(AzureConfiguration.java:90)
在 com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.getHubConfiguration(AzureIotProtocolAdapter.java:375)
在 com.thingworx.protocol.azure.iot.AzureIotProtocolAdapter.initialize(AzureIotProtocolAdapter.java:326)
... 11 更多
原因:javax.crypto.BadPaddingException:给定的最终块未正确填充。如果在解密过程中使用了错误的密钥,就会出现此类问题。
在 com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975)
在 com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
在 com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:941)
在 com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:491)
在 javax.crypto.Cipher.doFinal(Cipher.java:2111)
在 com.thingworx.security.encryption.SecureBytes.cipherData(SecureBytes.java:172)
... 还有 17 个
- java.lang.IllegalStateException:无法从平台获取 Azure IoT 中心配置
这是文章 316173 的 PDF 版本,可能已过期。最新版本 CS316173