从数据库中获取值时出现上述错误。如果我想设置它,muleContext的值是多少?下面是我的配置xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:context="http://www.springframework.org/schema/context" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:x12-edi="http://www.mulesoft.org/schema/mule/x12-edi" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/x12-edi http://www.mulesoft.org/schema/mule/x12-edi/current/mule-x12-edi.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd">
<x12-edi:config name="X12_EDI_files" doc:name="X12 EDI">
<x12-edi:schemas>
<x12-edi:schema>/x12/005010/850.esl</x12-edi:schema>
</x12-edi:schemas>
</x12-edi:config>
<context:property-placeholder location="DBConnection.properties"/>
<db:mysql-config name="MySQL_Configuration_Insert" host="${db.host}" port="${db.port}" user="${db.username}" password="${db.password}" database="${db.database}" doc:name="MySQL Configuration"/>
<flow name="edi_retailFlow">
<file:inbound-endpoint path="src/main/resources/input" moveToPattern="#[message.inboundProperties.originalFilename]_archive.edi" moveToDirectory="src/main/resources/output" responseTimeout="10000" doc:name="Read File"/>
<x12-edi:read config-ref="X12_EDI_files" doc:name="Reads X12 EDI message"/>
<enricher target="#[flowVars.batchResult]" doc:name="Message Enricher">
<choice doc:name="Choice">
<when expression="#[message.inboundProperties.originalFilename contains 810]">
<batch:execute name="Process_810_Batch" doc:name="Process_810_Batch"/>
</when>
<when expression="#[message.inboundProperties.originalFilename contains 850]">
<batch:execute name="Process_850_Batch" doc:name="Process_850_Batch"/>
</when>
</choice>
</enricher>
<flow-ref name="Send_Ack" doc:name="Send_Ack"/>
</flow>
<flow name="Send_Ack">
<dw:transform-message doc:name="Transform 997 Ack">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
TransactionSets: {
v005010: {
"997": payload.FunctionalAcksGenerated
}
}
}]]></dw:set-payload>
</dw:transform-message>
<x12-edi:write config-ref="X12_EDI_files" doc:name="X12 EDI">
<x12-edi:map ref="#[payload]"/>
</x12-edi:write>
<file:outbound-endpoint path="src/main/resources/output" outputPattern="#[message.inboundProperties.originalFilename]_997.edi" responseTimeout="10000" doc:name="File"/>
</flow>
<batch:job name="Process_850_Batch">
<batch:input>
<dw:transform-message metadata:id="973d0231-b863-428a-8414-eb6a2d69b15b" doc:name="Process 850">
<dw:input-payload mimeType="application/java"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload.TransactionSets.v005010."850"]]></dw:set-payload>
</dw:transform-message>
</batch:input>
<batch:process-records>
<batch:step name="Batch_Step">
<dw:transform-message metadata:id="e7c299fd-8246-4cca-9466-9f81db4a8498" doc:name="Object to Json">
<dw:input-payload doc:sample="sample_data\map_2.dwl"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
{
purchaseOrder: {
purchaseOrderNumber: payload.Heading."0200_BEG".BEG03,
transactionCode: payload.Heading."0200_BEG".BEG01,
transactionTypeCode: payload.Heading."0200_BEG".BEG02,
dateTime: payload.Heading."0200_BEG".BEG05 as :string,
currency: payload.Heading."0400_CUR".CUR02,
buyerDetailspayload.Heading."3100_N1_Loop" map ((v3100Loop,indexOfv3100Loop) -> {
billToName: v3100Loop."3100_N1".N102,
(btn_contact: v3100Loop."3600_PER"[0].PER04) when v3100Loop."3600_PER"[0].PER03=='TE',
btn_address: v3100Loop."3300_N3"[0].N301
} when v3100Loop."3100_N1".N101 =='BT' otherwise '')),
shipperDetailspayload.Heading."3100_N1_Loop" map ((v3100Loop,indexOfv3100Loop) -> {
shipToName: v3100Loop."3100_N1".N102,
(stn_contact: v3100Loop."3600_PER"[0].PER04) when v3100Loop."3600_PER"[0].PER03=='TE',
stn_address: v3100Loop."3300_N3"[0].N301
} when v3100Loop."3100_N1".N101 =='ST' otherwise '')),
productDetails: (payload.Detail."0100_PO1_Loop" map ((v0100Loop, indexOfv0100Loop) -> {
productName: v0100Loop."0500_PID_Loop"[0]."0500_PID".PID05,
quantity: v0100Loop."0100_PO1".PO102,
price: v0100Loop."0100_PO1".PO104 as :string
}))
}
}]]></dw:set-payload>
</dw:transform-message>
<dw:transform-message metadata:id="69ab44ca-d9c5-4436-9093-77fca72a7dd7" doc:name="Trim Null">
<dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
{
purchaseOrder: {
purchaseOrderNumber: payload.purchaseOrder.purchaseOrderNumber,
transactionCode: payload.purchaseOrder.transactionCode,
transactionTypeCode: payload.purchaseOrder.transactionTypeCode,
dateTime: payload.purchaseOrder.dateTime,
currency: payload.purchaseOrder.currency,
(buyerDetails: {
billToName: payload.purchaseOrder.buyerDetails.billToName,
btn_contact: payload.purchaseOrder.buyerDetails.btn_contact,
btn_address: payload.purchaseOrder.buyerDetails.btn_address
}) when payload.purchaseOrder.buyerDetails.billToName !='',
(shipperDetails: {
shipToName: payload.purchaseOrder.shipperDetails.shipToName,
stn_contact: payload.purchaseOrder.shipperDetails.stn_contact,
stn_address: payload.purchaseOrder.shipperDetails.stn_address
}) when payload.purchaseOrder.shipperDetails.shipToName !='',
productDetailspayload.purchaseOrder.productDetails map ((vprod, indexOfvprod) -> {
productName: vprod.productName,
quantity: vprod.quantity,
price: vprod.price
}))
}
}]]></dw:set-payload>
</dw:transform-message>
<logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
<dw:transform-message doc:name="Json to Object">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload]]></dw:set-payload>
</dw:transform-message>
<set-variable variableName="InputPayload" value="#[payload]" doc:name="Variable"/>
<db:insert config-ref="MySQL_Configuration_Insert" doc:name="Insert in Buyer_Table">
<db:parameterized-query><![CDATA[insert into Buyer_Table (billtoname, btn_contact, btn_address, shiptoname, stn_contact, stn_address) values (#[flowVars.InputPayload.purchaseOrder.buyerDetails.billToName], #[flowVars.InputPayload.purchaseOrder.buyerDetails.btn_contact],#[flowVars.InputPayload.purchaseOrder.buyerDetails.btn_address],#[flowVars.InputPayload.purchaseOrder.shipperDetails.shipToName],#[flowVars.InputPayload.purchaseOrder.shipperDetails.stn_contact], #[flowVars.InputPayload.purchaseOrder.shipperDetails.stn_address]);]]></db:parameterized-query>
</db:insert>
<db:select config-ref="MySQL_Configuration_Insert" doc:name="Get buyer_id">
<db:parameterized-query><![CDATA[SELECT buyer_id FROM Buyer_Table WHERE buyer_id = (SELECT MAbuyer_id) FROM Buyer_Table);]]></db:parameterized-query>
</db:select>
<db:insert config-ref="MySQL_Configuration_Insert" doc:name="Insert in PO_Table">
<db:parameterized-query><![CDATA[insert into PO_Table (buyer_id,purchaseorder_no,transaction_type,transaction_code,date_time,currency)
values (#[payload[0].buyer_id],#[flowVars.InputPayload.purchaseOrder.purchaseOrderNumber], #[flowVars.InputPayload.purchaseOrder.transactionTypeCode],#[flowVars.InputPayload.purchaseOrder.transactionCode],#[flowVars.InputPayload.purchaseOrder.dateTime],#[flowVars.InputPayload.purchaseOrder.currency]);]]></db:parameterized-query>
</db:insert>
<db:select config-ref="MySQL_Configuration_Insert" doc:name="Get po_no">
<db:parameterized-query><![CDATA[SELECT po_no FROM PO_Table WHERE po_no = (SELECT MApo_no) FROM PO_Table);]]></db:parameterized-query>
</db:select>
<db:insert config-ref="MySQL_Configuration_Insert" bulkMode="true" doc:name="Insert in Product_Table">
<db:parameterized-query><![CDATA[insert into Product_Table (po_no,product_name,quantity,unit_price) values (#[payload[0].po_no],#[flowVars.InputPayload.purchaseOrder.productDetails.productName],#[flowVars.InputPayload.purchaseOrder.productDetails.quantity],#[flowVars.InputPayload.purchaseOrder.productDetails.price]);]]></db:parameterized-query>
</db:insert>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</batch:step>
</batch:process-records>
<batch:on-complete>
<logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
</batch:on-complete>
</batch:job>
<batch:job name="Process_810_Batch">
<batch:input>
<dw:transform-message metadata:id="6d57575e-bbca-46ca-88f8-565f438dcf79" doc:name="Transform Message">
<dw:input-payload mimeType="application/java"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload.TransactionSets.v005010."810"]]></dw:set-payload>
</dw:transform-message>
</batch:input>
<batch:process-records>
<batch:step name="Batch_Step1">
<logger message=""In 810"" level="INFO" doc:name="Logger"/>
</batch:step>
</batch:process-records>
<batch:on-complete>
<logger message=""Batch 810 complete"" level="INFO" doc:name="Logger"/>
</batch:on-complete>
</batch:job>
</mule>
我认为muleContext会自动传递,但是对于这个错误,如何设置muleContext属性?