當我嘗試在 Anypoint 中部署 mule 應用程式時,出現以下例外:
ERROR 2022-10-06 16:52:21,942 [WrapperListener_start_runner] org.mule.runtime.module.deployment.internal.DefaultArchiveDeployer: Failed to deploy artifact [mambo-supply-4]
org.mule.runtime.deployment.model.api.DeploymentException: Failed to deploy artifact [mambo-supply-4]
Caused by: org.mule.runtime.api.exception.MuleRuntimeException: org.mule.runtime.deployment.model.api.DeploymentInitException: MuleRuntimeException: Could not find ErrorType for the given identifier: 'APIKIT:NOT_VALID_ACCESS_OAUTH'
我對此進行了研究,發現 APIKIT 的不同型別的錯誤,但不是這個,這是什么意思以及如何解決它的任何想法?
我假設例外是在目錄 src/main/mule 中的 endpoint.xml 檔案中引發的:
<on-error-propagate type="APIKIT:NOT_VALID_ACCESS_OAUTH">
<ee:transform doc:name="Transform Message" doc:id="a571ce2a-3c56-4028-905c-a4324e45baa4">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0 output application/json --- {"code": 401, "message": "Not authorized or bad credentials" } ]]></ee:set-payload>
</ee:message>
<ee:variables>
<ee:set-variable variableName="httpStatus"><![CDATA[%dw 2.0 output application/java --- 401]]></ee:set-variable>
<ee:set-variable variableName="Content-Type" ><![CDATA[%dw 2.0 output application/java --- "application/json"]]></ee:set-variable>
</ee:variables>
</ee:transform>
<flow-ref name="logErrorEndGlobalException" doc:name="logErrorEndGlobalException" />
</on-error-propagate>
uj5u.com熱心網友回復:
在 Mule 4 中,一些錯誤是內置的,由 Mule 運行時提供,一些錯誤是由連接器/模塊提供的。在此錯誤中,前綴APIKIT:表示它來自 APIKit 模塊。查看APIKit 錯誤的檔案,它提到了這些錯誤:
- APIKIT:BAD_REQUEST
- APIKIT:NOT_FOUND
- APIKIT:METHOD_NOT_ALLOWED
- APIKIT:NOT_ACCEPTABLE
- APIKIT:UNSUPPORTED_MEDIA_TYPE
由于它不是記錄在案的錯誤,因此在其他任何地方都沒有提及此錯誤,并且在部署時無法識別,我只能假設它是程式員錯誤。我不知道是否有人相信他們可以添加新的錯誤,但它不會那樣作業。如果這是自動生成的,則可能是錯誤。
在任何情況下,您都應該洗掉整個<on-error-propagate>元素,因為它參考了一個不存在的錯誤。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/511443.html
