DecodeJWT 政策部署错误问题排查
<ph type="x-smartling-placeholder"></ph>
您正在查看 Apigee Edge 文档。
转到
Apigee X 文档。 信息
InvalidEmptyElement
错误消息
通过 Edge 界面或 Edge Management API 部署 API 代理失败
并显示以下错误消息:
Error Saving Revision
Invalid empty element : policy(policy_name) element(Source)
错误消息示例
Error Saving Revision
Invalid empty element : policy(Decode_JWT) element(Source).
示例屏幕截图
在 Edge 界面中,您将看到一个包含以下错误的对话框:
原因
如果未在 DecodeJWT 政策的 <Source>
元素中指定包含要解码的 JWT 的流变量,则会出现此错误。
例如,如果 <Source>
元素不包含值,则会出现错误,如下所示:
<Source></Source>
诊断
确定 DecodeJWT 政策的名称以及错误消息中空元素的名称。例如,在以下错误消息中,DecodeJWT 政策的名称为 Decode_JWT
,元素名称为 Source
。
Invalid empty element : policy(Decode_JWT) element(Source).
检查 DecodeJWT 政策,并验证在第 1 步中标识的元素是否为空。如果元素为空,则会导致错误。
以下是 DecodeJWT 政策示例:
<DecodeJWT name="Decode_JWT">
<DisplayName>JWT Decode HS256</DisplayName>
<Source></Source>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</DecodeJWT>
因为 <Source>
元素为空,所以您会收到以下错误:
Invalid empty element : policy(Decode_JWT) element(Source).
解决方法
确保 <Source>
元素在流变量中指定有效的 JWT。
如需解决 DecodeJWT 政策示例的问题,您可以在 <Source>
元素中指定包含有效 JWT 的流变量。
<DecodeJWT name="Decode_JWT">
<DisplayName>JWT Decode HS256</DisplayName>
<Source>var.jwt</Source>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</DecodeJWT>
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-12。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
{"lastModified": "\u6700\u540e\u66f4\u65b0\u65f6\u95f4 (UTC)\uff1a2024-09-12\u3002"}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-09-12。"],[],[]]