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

时间:2018-12-19 21:12:01

标签: java maven cors mule mule-studio

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

除了在MuleSoft论坛上的一个问题:https://forums.mulesoft.com/questions/71349/orgmuleapimuleruntimeexception-corsmanager-not-sta.html?childToView=78861#answer-78861之外,我在互联网上找不到更多的相关信息。问题确实有答案,但是此应用程序根本不使用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尚未在以下位置启动   org.mule.modules.cors.CorsPhase.runPhase(CorsPhase.java:65)   〜[mule-module-cors-gw-3.9.0.jar:3.9.0]在   org.mule.modules.cors.CorsPhase.runPhase(CorsPhase.java:39)   〜[mule-module-cors-gw-3.9.0.jar:3.9.0]在   org.mule.execution.PhaseExecutionEngine $ InternalPhaseExecutionEngine.process(PhaseExecutionEngine.java:114)   〜[mule-core-3.9.0.jar:3.9.0]在   org.mule.execution.PhaseExecutionEngine.process(PhaseExecutionEngine.java:41)   〜[mule-core-3.9.0.jar:3.9.0]在   org.mule.execution.MuleMessageProcessingManager.processMessage(MuleMessageProcessingManager.java:32)   〜[mule-core-3.9.0.jar:3.9.0]在   org.mule.module.http.internal.listener.DefaultHttpListener $ 1.handleRequest(DefaultHttpListener.java:135)   〜[mule-module-http-3.9.0.jar:3.9.0],位于   org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:100)   〜[mule-module-http-3.9.0.jar:3.9.0],位于   org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)   〜[grizzly-framework-2.3.33.jar:2.3.33]在   org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:119)   〜[mule-module-http-3.9.0.jar:3.9.0],位于   org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access $ 100(ExecutorPerServerAddressIOStrategy.java:31)   〜[mule-module-http-3.9.0.jar:3.9.0],位于   org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy $ WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:142)   〜[mule-module-http-3.9.0.jar:3.9.0],位于   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)   [?:1.8.0_162]在   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的任何提及。您能提供的任何帮助都将受到赞赏。

2 个答案:

答案 0 :(得分:0)

由于缺少wsdl和域配置,因此无法复制。

您的域可能是这里的元凶:org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead

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

答案 1 :(得分:0)

不确定问题出在哪里,但这与我在WSDL和schemalocation URL中更改的名称空间有关。我将WSDL恢复为已知的工作版本,并能够部署该应用程序。