1

我有一个 web 服务,它公开了几种将数组作为输入的方法。我已经在 mule-config.xml 文件中为我的服务实现定义了一个流,并且可以从服务公开的 WSDL 创建我的 WCF 客户端。

如果我尝试调用这些方法之一,这些方法接受一个数组作为我的客户端的输入,我会收到以下异常:

WARN  2011-10-06 13:38:02,139 [connector.http.mule.default.receiver.3] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://api.data.ws.occ600.emsgt.com/}ConfigurationServiceService#{http://api.data.ws.occ600.emsgt.com/}create has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Component that caused exception is: DefaultJavaComponent{configurationService.commponent.32217869}. Message payload is of type: MapExtent[]
    at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:85)
    at org.mule.module.cxf.MuleJAXWSInvoker.invoke(MuleJAXWSInvoker.java:47)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
    at org.mule.module.cxf.CxfInboundMessageProcessor.sendToDestination(CxfInboundMessageProcessor.java:288)
    at org.mule.module.cxf.CxfInboundMessageProcessor.process(CxfInboundMessageProcessor.java:129)
    at org.mule.module.cxf.config.FlowConfiguringMessageProcessor.process(FlowConfiguringMessageProcessor.java:50)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.processor.SecurityFilterMessageProcessor.process(SecurityFilterMessageProcessor.java:77)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.processor.ExceptionHandlingMessageProcessor.process(ExceptionHandlingMessageProcessor.java:25)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:185)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:158)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:145)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:247)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:206)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:164)
    at org.mule.work.WorkerContext.run(WorkerContext.java:309)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.component.ComponentException: Component that caused exception is: DefaultJavaComponent{configurationService.commponent.32217869}. Message payload is of type: MapExtent[]
    at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:359)
    at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:86)
    at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:77)
    at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)
    at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:56)
    at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:234)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)
    at org.mule.component.AbstractComponent.process(AbstractComponent.java:154)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:97)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:41)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)
    at org.mule.construct.AbstractFlowConstruct$1$1.process(AbstractFlowConstruct.java:107)
    at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:90)
    at org.mule.module.cxf.CxfInboundMessageProcessor.processNext(CxfInboundMessageProcessor.java:328)
    at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:80)
    ... 39 more
Caused by: org.mule.model.resolvers.EntryPointNotFoundException: Failed to find entry point for component, the following resolvers tried but failed: [
ArrayEntryPointResolver: Found too many possible methods on object "com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2" that accept parameters "{class [Lcom.emssatcom.occ600.dal.api.MapExtent;}", Methods matched are "[public final void com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.delete(com.emsgt.data.api.EMSRecord[]) throws com.emssatcom.occ600.dal.api.DALException, public final com.emssatcom.occ600.dal.api.MapExtent[] com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.create(com.emssatcom.occ600.dal.api.MapExtent[]) throws com.emssatcom.occ600.dal.api.DALException, public final void com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.update(com.emssatcom.occ600.dal.api.MapExtent[]) throws com.emssatcom.occ600.dal.api.DALException, public final void com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.createEx(com.emsgt.data.api.EMSRecord[]) throws com.emssatcom.occ600.dal.api.DALException, public final void com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.updateOnly(com.emsgt.data.api.EMSRecord[]) throws com.emssatcom.occ600.dal.api.DALException, public final void com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2.updateOrInsert(com.emsgt.data.api.EMSRecord[]) throws com.emssatcom.occ600.dal.api.DALException]"
ReflectionEntryPointResolver: Could not find entry point on: "com.emsgt.occ600.ws.data.lib.ConfigurationServiceImpl$$EnhancerByCGLIB$$7277bad2" with arguments: "{class com.emssatcom.occ600.dal.api.MapExtent,class com.emssatcom.occ600.dal.api.MapExtent}"
]
    at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:52)
    at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:350)

经过进一步调查,我找到了数组入口点解析器。将其添加到我的 mule-config 如下

  <component>
           <entry-point-resolver-set>
                <reflection-entry-point-resolver/>
                <array-entry-point-resolver />
        </entry-point-resolver-set>

    <spring-object bean="myWebService"/>
</component> 

仍然没有帮助。有这方面的经验吗?

4

1 回答 1

0

我最终使用了数组入口点解析器、方法入口点解析器和 API 签名更改的组合来解决这个问题。这里的问题是,Mule 使用 web 服务调用的参数来确定要使用的方法而不是方法名称,即使它的文档说明它使用了一堆解析器,包括方法入口点解析器。

因此,如果您有一个接口公开了两个不同命名的方法,都接受一个类型为 T 的数组,那么解析器的组合将无法确保调用正确的方法。据我所知没有。如果您在 method-entry-point-resolver 集合中指定这两种方法,如下所示:

<method-entry-point-resolver>
                <include-entry-point method="method1"/>
                <include-entry-point method="method2"/> 
            </method-entry-point-resolver>

Mule 总是调用 method1,如果输入参数是 T[],忽略方法名。

如果你试试这个:

<method-entry-point-resolver>
                <include-entry-point method="method1"/>                                         
            </method-entry-point-resolver>
            <array-entry-point-resolver>
               <include-entry-point method="method2"/>                 
            </array-entry-point-resolver> 

Mule 始终没有调用正确的方法。所以我最终创建了一个简单地包装 T[] 并将其更改为方法 1 的输入参数的类。在方法入口点解析器的集合中配置了方法1,在数组入口点解析器的集合中配置了方法2,这可以工作。

这显然是一个问题,但我无法让 MuleSoft 人员做出回应。

于 2011-11-01T13:47:12.990 回答