org.mule.api.MuleRuntimeException: CorsManager 尚未启动

org.mule.api.MuleRuntimeException: CorsManager not started yet

我目前正在开发处理 REST 和 SOAP 请求的 Mule 3.9 应用程序。 REST 端工作正常,但是我 运行 遇到了 SOAP 功能的一个奇怪问题。现在,该文件只是 HTTP 侦听器、一个 SOAP 路由器和两个流,每个流用于不同的进程,每个流包含一个记录器。但是,当我尝试 运行 项目时,它无法部署,引用 MuleRuntimeException:CorsManager 尚未启动。我很困惑,因为这个项目根本没有使用 CORS。

除了 MuleSoft 论坛上的一个问题:https://forums.mulesoft.com/questions/71349/orgmuleapimuleruntimeexception-corsmanager-not-sta.html?childToView=78861#answer-78861,我在 Internet 上找不到太多相关信息。这个问题是有答案的,但是这个应用根本没有使用MQ,所以这个方案不适用。

这是我的XML:

    <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit- 
   soap="http://www.mulesoft.org/schema/mule/apikit-soap" 
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
    xmlns:http="http://www.mulesoft.org/schema/mule/http" 
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core 
    http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/http 
    http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    http://www.mulesoft.org/schema/mule/apikit-soap 
    http://www.mulesoft.org/schema/mule/apikit-soap/current/mule-apikit- 
   soap.xsd">
      <apikit-soap:config name="/bt2dm/MuleSoapProc/api-config" 
    wsdlUrl="pdw.wsdl" serviceName="bt2m" portName="MuleSoapProc" 
    doc:name="APIkit SOAP: Configuration"/>
      <flow name="api-main">
        <http:listener path="/bt2m/MuleSoapProc" config-ref="mule-domain- 
   http-listener-config" doc:name="/bt2m/MuleSoapProc" 
    allowedMethods="POST, GET"/>
        <apikit-soap:router config-ref="/bt2m/MuleSoapProc/api-config" 
    doc:name="SOAP Router"/>
            <exception-strategy ref="apiKitGlobalExceptionMapping" 
    doc:name="Reference Exception Strategy"/>
      </flow>
      <flow name="OperationPDwCL2Way:/bt2m/MuleSoapProc/api-config">
            <logger level="INFO" doc:name="Logger"/>
            <exception-strategy ref="apiKitGlobalExceptionMapping" 
    doc:name="Reference Exception Strategy"/>
      </flow>
      <flow name="OperationPDwTL2Way:/bt2m/MuleSoapProc/api-config">
            <logger level="INFO" doc:name="Logger"/>
            <exception-strategy ref="apiKitGlobalExceptionMapping" 
    doc:name="Reference Exception Strategy"/>
      </flow>
    </mule>

这是 WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://Mule/Claims/PDW/Mule_Claims_CC_PDW/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="CompanyPDw" targetNamespace="http://Mule/Claims/PDW/Mule_Claims_CC_PDW/">
    <wsdl:documentation>
        <CreationInfo Created="2018-12-17 08:14:00Z"/>
    </wsdl:documentation>
    <wsdl:types>
        <xsd:schema targetNamespace="http://Mule/C/PDW/MuleCDW/Imports">
            <xsd:import schemaLocation="http://localhost:8163/pdw/MuleSoapProc?xsd=xsd2" namespace="http://company.com/claimcenter/DW/DWClaim"/>
            <xsd:import schemaLocation="http://localhost:8163/pdw/MuleSoapProc?xsd=xsd3" namespace="http://company_Mule_PDW.PDwCCStatResponse"/>
            <xsd:import schemaLocation="http://localhost:8163/pdw/MuleSoapProc?xsd=xsd4" namespace="http://company.com/claimcenter/DW/DWTransaction"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="WcfService_Mule_Claims_CC_PDW_OperationPDwCL2Way_InputMessage">
        <wsdl:part xmlns:q1="http://company.com/DW/DWClaim" name="part" element="q1:DWClaim"/>
    </wsdl:message>
    <wsdl:message name="WcfService_Mule_Claims_CC_PDW_OperationPDwCL2Way_OutputMessage">
        <wsdl:part xmlns:q2="http://company_Mule_PDw.PDwCCStatResponse" name="part" element="q2:PDwStatResponse"/>
    </wsdl:message>
    <wsdl:message name="WcfService_Mule_Claims_CC_PDW_OperationPDwTL2Way_InputMessage">
        <wsdl:part xmlns:q3="http://company.com/DW/DWTransaction" name="part" element="q3:DWTransaction"/>
    </wsdl:message>
    <wsdl:message name="WcfService_Mule_Claims_CC_PDW_OperationPDwTL2Way_OutputMessage">
        <wsdl:part xmlns:q4="http://company_Mule_PDw.PDwCCStatResponse" name="part" element="q4:PDwStatResponse"/>
    </wsdl:message>
    <wsdl:portType name="WcfService_Mule_Claims_CC_PDW">
        <wsdl:documentation>service "*" port "*"</wsdl:documentation>
        <wsdl:operation name="OperationPDwCL2Way">
            <wsdl:documentation>operation "OperationPDwCL2Way"</wsdl:documentation>
            <wsdl:input message="tns:WcfService_Mule_Claims_CC_PDW_OperationPDwCL2Way_InputMessage"/>
            <wsdl:output message="tns:WcfService_Mule_Claims_CC_PDW_OperationPDwCL2Way_OutputMessage"/>
        </wsdl:operation>
        <wsdl:operation name="OperationPDwTL2Way">
            <wsdl:documentation>operation "OperationPDwTL2Way"</wsdl:documentation>
            <wsdl:input message="tns:WcfService_Mule_Claims_CC_PDW_OperationPDwTL2Way_InputMessage"/>
            <wsdl:output message="tns:WcfService_Mule_Claims_CC_PDW_OperationPDwTL2Way_OutputMessage"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MuleSoapProc" type="tns:WcfService_Mule_Claims_CC_PDW">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="OperationPDwCL2Way">
            <wsdl:documentation>operation "OperationPDwCL2Way"</wsdl:documentation>
            <soap:operation soapAction="OperationPDwCL2Way" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="OperationPDwTL2Way">
            <wsdl:documentation>operation "OperationPDwTL2Way"</wsdl:documentation>
            <soap:operation soapAction="OperationPDwTL2Way" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="g1PDw">
        <wsdl:port name="MuleSoapProc" binding="tns:MuleSoapProc">
            <soap:address location="http://localhost:8163/PDw/insertService"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

这是在应用程序启动期间抛出的错误:

org.mule.api.MuleRuntimeException: CorsManager not started yet at org.mule.modules.cors.CorsPhase.runPhase(CorsPhase.java:65) ~[mule-module-cors-gw-3.9.0.jar:3.9.0] at org.mule.modules.cors.CorsPhase.runPhase(CorsPhase.java:39) ~[mule-module-cors-gw-3.9.0.jar:3.9.0] at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.process(PhaseExecutionEngine.java:114) ~[mule-core-3.9.0.jar:3.9.0] at org.mule.execution.PhaseExecutionEngine.process(PhaseExecutionEngine.java:41) ~[mule-core-3.9.0.jar:3.9.0] at org.mule.execution.MuleMessageProcessingManager.processMessage(MuleMessageProcessingManager.java:32) ~[mule-core-3.9.0.jar:3.9.0] at org.mule.module.http.internal.listener.DefaultHttpListener.handleRequest(DefaultHttpListener.java:135) ~[mule-module-http-3.9.0.jar:3.9.0] at org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:100) ~[mule-module-http-3.9.0.jar:3.9.0] at org.glassfish.grizzly.filterchain.ExecutorResolver.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.33.jar:2.3.33] at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:119) ~[mule-module-http-3.9.0.jar:3.9.0] at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access0(ExecutorPerServerAddressIOStrategy.java:31) ~[mule-module-http-3.9.0.jar:3.9.0] at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:142) ~[mule-module-http-3.9.0.jar:3.9.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]

我在这个项目中也找不到任何提及 CORS 的地方。感谢您提供的任何帮助。

由于缺少 wsdl 和域配置,无法重现。

您的域可能是这里的罪魁祸首:org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead

如果可能,请尝试将您的应用程序从使用域中提取出来。如果您能够重现,请使用简化的应用程序更新问题。

不确定到底是什么问题,但它与我在 WSDL 中更改的名称空间和模式分配 URL 相关。我将 WSDL 还原为已知的工作版本并能够部署该应用程序。