我尝试从 Anypoint Studio IDE 在运行时 4.6.7 下运行我的 Mule 应用程序。 它启动失败并抛出错误(无法调用“Object.getClass()”,因为“c”为空)我的流程“imp_get: est 1\服务订单(serviceOrderId)" 任何如何调试此类错误的提示或建议将非常受欢迎
请参阅下面的错误和流程
Caused by: org.mule.runtime.core.api.config.ConfigurationException: Error creating bean with name 'imp_get:\rest\v1\service-orders\(serviceOrderId)': Cannot create inner bean '(inner bean)#6f0369bd' of type [org.mule.runtime.config.internal.factories.ErrorHandlerFactoryBean_ByteBuddy_org_mule_runtime_core_internal_exception_ErrorHandler] while setting bean property 'exceptionListener'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6f0369bd': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "c" is null
at org.mule.runtime.module.deployment.impl.internal.artifact.ArtifactContextBuilder.lambda$build$1(ArtifactContextBuilder.java:531) ~[mule-module-deployment-model-impl-4.6.7.jar:?]
at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:224) ~[mule-core-4.6.7.jar:?]
at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:1102) ~[mule-core-4.6.7.jar:?]
at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:1020) ~[mule-core-4.6.7.jar:?]
<flow name="imp_get:\rest\v1\service-orders\(serviceOrderId)" doc:id="025691fe-eb05-4cc5-be58-c5d31b028c62" >
<ee:transform doc:name="init vars" doc:id="6979887a-1fae-4af8-b102-9e3d78e2dd80">
<ee:message />
<ee:variables>
<ee:set-variable variableName="operationType"><![CDATA[%dw 2.0
output application/java
---
"api-rest"]]></ee:set-variable>
<ee:set-variable variableName="operationStatus"><![CDATA["success"]]></ee:set-variable>
<ee:set-variable variableName="businessEntityDetails"><![CDATA[%dw 2.0
output application/json
---
{
serviceOrderId: attributes.uriParams.serviceOrderId
}]]></ee:set-variable>
<ee:set-variable variableName="originalAttributes"><![CDATA[attributes]]></ee:set-variable>
<ee:set-variable variableName="noDataFound"><![CDATA[%dw 2.0
output application/java
---
false]]></ee:set-variable>
<ee:set-variable variableName="businessEntityId" ><![CDATA[%dw 2.0
output application/java
---
attributes.uriParams.serviceOrderId]]></ee:set-variable>
</ee:variables>
</ee:transform>
<ee:transform doc:name="request serice order" doc:id="9f14f0b2-21ee-43c4-b902-69e286c27e3a" >
<ee:message >
</ee:message>
<ee:variables >
<ee:set-variable variableName="serviceOrderId" ><![CDATA[%dw 2.0
import * from dw::core::URL
output application/json
---
encodeURI(attributes.uriParams.serviceOrderId)]]></ee:set-variable>
<ee:set-variable variableName="queryParam" ><![CDATA[%dw 2.0
var expandSpecificData = (attributes.queryParams.expandSpecificData default "false") == "true"
var expandTextData = (attributes.queryParams.expandTextData default "false") == "true"
var expandPartnerData = (attributes.queryParams.expandPartnerData default "false") == "true"
---
{
expandSpecificData: expandSpecificData,
expandTextData: expandTextData,
expandPartnerData: expandPartnerData
}]]></ee:set-variable>
<ee:set-variable variableName="requestHeader" ><![CDATA[output application/java
---
{
x_conversation_id: attributes.headers.'X-Conversation-Id'
}]]></ee:set-variable>
</ee:variables>
</ee:transform>
<try doc:name="Try" doc:id="4d92f031-cc98-4a38-9349-4a3ae98372f7" >
<http:request method="GET" doc:name="Request" doc:id="e0b3e101-97ae-45f9-980d-2bba12a19ef3" config-ref="HTTP_get_codex-closing-sys" path="${codex-closing-sys.path-serviceOrderId}" />
<error-handler >
<on-error-continue enableNotifications="true" logException="true" doc:name="On Error Continue" doc:id="5718ba83-be9f-4f0c-9716-7dd552ca2ebd" >
<ee:transform doc:name="Transform Message" doc:id="a61dae32-5918-4efc-b175-0bc79def06a3" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
error
//error.muleMessage.typedValue]]></ee:set-payload>
</ee:message>
<ee:variables >
<ee:set-variable variableName="operationStatus" ><![CDATA["error"]]></ee:set-variable>
<ee:set-variable variableName="httpStatus" ><![CDATA[404]]></ee:set-variable>
<ee:set-variable variableName="responseError" ><![CDATA[%dw 2.0
output application/json
---
{
"type": "CLOSING-EXP:NOT_FOUND",
"message": "The serviceOrder is not found"
}]]></ee:set-variable>
</ee:variables>
</ee:transform>
</on-error-continue>
</error-handler>
</try>
<choice doc:name="Choice" doc:id="0e92c648-0251-462e-9f4b-fc1a6ccf422d" >
<when expression="#[!isEmpty(payload.data)]">
<ee:transform doc:name="responseCodex" doc:id="d2044aea-b1fd-4a75-874c-4ed8c925d3d1" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
if(!isEmpty(payload.data.serviceOrderHeader))
(payload.data)
else
({})
]]></ee:set-payload>
</ee:message>
</ee:transform>
<ee:transform doc:name="init companyCode" doc:id="8399099b-c8fd-43b0-a96a-19636de7be74">
<ee:message>
</ee:message>
<ee:variables>
<ee:set-variable variableName="companyCode"><![CDATA[%dw 2.0
output application/java
---
payload.data.serviceOrderHeader.companyCode]]></ee:set-variable>
</ee:variables>
</ee:transform>
<flow-ref doc:name="getAuthorization" doc:id="2fa53737-4811-4470-b30f-edf7f1e5df8e" name="getAuthorization"/>
</when>
<otherwise >
<ee:transform doc:name="noDataFound" doc:id="1904f051-8456-4756-a63e-4b0df1d6eae9" >
<ee:message />
<ee:variables >
<ee:set-variable variableName="noDataFound" ><![CDATA[%dw 2.0
output application/java
---
true]]></ee:set-variable>
</ee:variables>
</ee:transform>
</otherwise>
</choice>
<ee:transform doc:name="responseData" doc:id="ec3eb206-0634-4951-b8bf-1d3f1672ab1c" >
<ee:message />
<ee:variables >
<ee:set-variable variableName="responseError" ><![CDATA[%dw 2.0
output application/json
---
if(vars.noDataFound)
{
"type": "ANALYTICS-EXP:NOT_FOUND",
"message": "The service order you are looking for does not exist."
}
else if (!vars.isAuthorized)
{
"type": "ANALYTICS-EXP:NOT_AUTHORIZED",
"message": "Unauthorized"
}
else if(!isEmpty(payload.error))
{
"type": "ANALYTICS-EXP:BAD_REQUEST",
"message": if(typeOf(payload.error) ~='Object') payload.error.message else payload.error
}
else
{}]]></ee:set-variable>
<ee:set-variable variableName="opretaionDetails" ><![CDATA[%dw 2.0
output application/json
---
if(!vars.noDataFound and vars.isAuthorized )
vars.operationDetails ++ { "httpStatus":200}
else
vars.operationDetails ++ { "httpStatus":400}
]]></ee:set-variable>
<ee:set-variable variableName="operationStatus" ><![CDATA[%dw 2.0
output application/json
---
if(!vars.noDataFound and vars.isAuthorized )
"success"
else
"error"]]></ee:set-variable>
<ee:set-variable variableName="responseData" ><![CDATA[%dw 2.0
output application/json
---
if(!vars.noDataFound and vars.isAuthorized )
vars.responseCodex
else
{}
]]></ee:set-variable>
<ee:set-variable variableName="httpStatus" ><![CDATA[%dw 2.0
output application/java
---
if(!vars.noDataFound and vars.isAuthorized )
200
else if (vars.httpStatus == 404)
404
else
400]]></ee:set-variable>
</ee:variables>
</ee:transform>
<error-handler />
</flow>
我找到了原因,之前有一个额外的,在GUI上,它看起来完全一样,但是当启动IDE时,它失败并出现奇怪的错误无法调用“Object.getClass()”,因为“c”为null