The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

daianacheng (3) [Avatar] Offline
#1
Hi,

I learned a lot about Mule ESB through your book and have developed a few applications but now I've come acrossed a problem which I have not managed to solved for quite some time. I monitor a local folder for new files arriving and then trigger a workflow of several web service calls via the CXF transport. This works perfectly fine when only one file arrives in the folder at a time, with more than one I get the exception below. Is this a known issue with Mule or am I doing something wrong? Any help would be much appreciated! I've been stuck with this for very long. I have tried this with Mule 2.1.1 and with Mule 2.1.2 and the same problem. The exceptions and config file are bellow.

Thank you very much in advance,
Diana.

----------------------------------------------------------------------------------------------------------------

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send message to Mule.
at org.mule.transport.cxf.transport.MuleUniversalConduit$1.handleMessage(MuleUniversalConduit.java:146)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:17smilie
at $Proxy43.putAssetsData(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mule.transport.cxf.CxfMessageDispatcher.doSendWithProxy(CxfMessageDispatcher.java:154)
at org.mule.transport.cxf.CxfMessageDispatcher.doSend(CxfMessageDispatcher.java:132)
at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:16smilie
at org.mule.transport.AbstractConnector.send(AbstractConnector.java:1929)
at org.mule.endpoint.DefaultOutboundEndpoint.send(DefaultOutboundEndpoint.java:77)
at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:71)
at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:64)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:69)
at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:903)
at org.mule.model.seda.SedaService.doSend(SedaService.java:235)
at org.mule.service.AbstractService.sendEvent(AbstractService.java:506)
at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:220)
at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:180)
at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:365)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:253)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:176)
at org.mule.transport.vm.VMMessageReceiver.onCall(VMMessageReceiver.java:107)
at org.mule.transport.vm.VMMessageDispatcher$2.doInTransaction(VMMessageDispatcher.java:125)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
at org.mule.transport.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:12smilie
at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:16smilie
at org.mule.transport.AbstractConnector.send(AbstractConnector.java:1929)
at org.mule.endpoint.DefaultOutboundEndpoint.send(DefaultOutboundEndpoint.java:77)
at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:106)
at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:64)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:69)
at org.mule.service.AbstractService.dispatchToOutboundRouter(AbstractService.java:87smilie
at org.mule.model.seda.SedaService.dispatchToOutboundRouter(SedaService.java:513)
at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:536)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
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(Thread.java:619)
Caused by: java.io.IOException: Could not send message to Mule.
at org.mule.transport.cxf.transport.MuleUniversalConduit.dispatchMuleMessage(MuleUniversalConduit.java:204)
at org.mule.transport.cxf.transport.MuleUniversalConduit$1.handleMessage(MuleUniversalConduit.java:142)
... 56 more
Caused by: org.mule.transport.service.TransportFactoryException: There are at least 2 connectors matching protocol "http", so the connector to use must be specified on the endpoint using the 'connector' property/attribute (java.lang.IllegalStateException)
at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:557)
at org.mule.endpoint.AbstractEndpointBuilder.getDefaultConnector(AbstractEndpointBuilder.java:270)
at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:265)
at org.mule.endpoint.AbstractEndpointBuilder.doBuildOutboundEndpoint(AbstractEndpointBuilder.java:18smilie
at org.mule.endpoint.AbstractEndpointBuilder.buildOutboundEndpoint(AbstractEndpointBuilder.java:95)
at org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultEndpointFactory.java:86)
at org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultEndpointFactory.java:62)
at org.mule.transport.cxf.transport.MuleUniversalConduit.dispatchMuleMessage(MuleUniversalConduit.java:17smilie
... 57 more
Caused by: java.lang.IllegalStateException: There are at least 2 connectors matching protocol "http", so the connector to use must be specified on the endpoint using the 'connector' property/attribute
at org.mule.transport.service.TransportFactory.getConnectorByProtocol(TransportFactory.java:16smilie
at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:547)
... 64 more

---------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.1" >
xmlns:file="http://www.mulesource.org/schema/mule/file/2.1"
xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.1"
xmlnssmiliem="http://www.mulesource.org/schema/mule/xml/2.1"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.1"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.1"
xsi:schemaLocation="
http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/schema/mule/core/2.1/mule.xsd
http://www.mulesource.org/schema/mule/file/2.1 http://www.mulesource.org/schema/mule/file/2.1/mule-file.xsd
http://www.mulesource.org/schema/mule/cxf/2.1 http://www.mulesource.org/schema/mule/cxf/2.1/mule-cxf.xsd
http://www.mulesource.org/schema/mule/xml/2.1 http://www.mulesource.org/schema/mule/xml/2.1/mule-xml.xsd
http://www.mulesource.org/schema/mule/stdio/2.1 http://www.mulesource.org/schema/mule/stdio/2.1/mule-stdio.xsd
http://www.mulesource.org/schema/mule/vm/2.1 http://www.mulesource.org/schema/mule/vm/2.1/mule-vm.xsd">

<file:connector name="MediaFileConnector" autoDelete="true" streaming="false" fileAge="40000" pollingFrequency="4000" outputPattern="#[ORIGINALNAME]" moveToDirectory="outbox">
<service-overrides messageAdapter="org.mule.transport.file.FileMessageAdapter" />
</file:connector>
<stdio:connector name="NormalStdioConnector" />
<custom-transformer class="mediaworkflow.transformers.importer.FileStreamToFileNameString" name="myTrans"/>

<model name="FileExample">
<service name="FileReceiver">
<inbound>
<file:inbound-endpoint path="inbox" fileAge="40000" connector-ref="MediaFileConnector"/>
</inbound>
<outbound>
<chaining-router>
<vm:outbound-endpoint path="media.pipeline.importer">
<transformer ref="myTrans"/>
</vm:outbound-endpoint>
</chaining-router>
</outbound>
</service>
<service name="MediaImportAndRepo">
<inbound>
<vm:inbound-endpoint synchronous="true" path="media.pipeline.importer"/>
</inbound>
<outbound>
<chaining-router>
<cxf:outbound-endpoint synchronous="true" remoteSync="true" address="http://localhost:8080/mediaworkflow.importer.engine/engine/importer" >
clientClass="mediaworkflow.engine.importer.stub.CImporterService"
wsdlLocation="http://localhost:8080/mediaworkflow.importer.engine/engine/importer?wsdl"
operation="doImport" wsdlPort="ImporterPort" />
<cxf:outbound-endpoint synchronous="true" remoteSync="true" address="http://localhost:8080/mediaworkflow.repository-asset.engine/engine/repository/asset" >
clientClass="mediaworkflow.engine.repository.asset.stub.CAssetRepository"
wsdlLocation="http://localhost:8080/mediaworkflow.repository-asset.engine/engine/repository/asset?wsdl"
operation="putAssetsData" wsdlPort="AssetRepositoryPort" />
<vm:outbound-endpoint path="media.pipeline.splitter"/>
</chaining-router>
</outbound>
</service>
<service name="Splitter">
<inbound>
<vm:inbound-endpoint path="media.pipeline.splitter"/>
</inbound>
<outbound>
<list-message-splitter-router>
<vm:outbound-endpoint path="media.pipeline.analyzer"/>
<payload-type-filter expectedType="java.util.List"/>
</list-message-splitter-router>
</outbound>
</service>
<service name="AnalyzerAndIndexer">
<inbound>
<vm:inbound-endpoint path="media.pipeline.analyzer"/>
</inbound>
<outbound>
<chaining-router>
<cxf:outbound-endpoint synchronous="true" remoteSync="true" address="http://localhost:8080/mediaworkflow.analyzer.engine/engine/analyzer" >
clientClass="mediaworkflow.engine.analyzer.stub.CArticleAnalyzerService"
wsdlLocation="http://localhost:8080/mediaworkflow.analyzer.engine/engine/analyzer?wsdl"
operation="doAnalyze" wsdlPort="AnalyzerPort" />
<cxf:outbound-endpoint synchronous="true" remoteSync="true" address="http://localhost:8080/mediaworkflow.repository-metadata/engine/repository/metadata" >
clientClass="mediaworkflow.engine.repository.metadata.stub.CMetaDataRepository"
wsdlLocation="http://localhost:8080/mediaworkflow.repository-metadata/engine/repository/metadata?wsdl"
operation="addMetaDataSet" wsdlPort="MetaDataRepositoryPort" />
<cxf:outbound-endpoint synchronous="true" remoteSync="true" address="http://localhost:8080/mediaworkflow.indexer.engine/engine/indexer" >
clientClass="mediaworkflow.engine.indexer.stub.CIndexerService"
wsdlLocation="http://localhost:8080/mediaworkflow.indexer.engine/engine/indexer?wsdl"
operation="indexDocument" wsdlPort="IndexerPort" />
<stdio:outbound-endpoint system="OUT" connector-ref="NormalStdioConnector"/>
</chaining-router>
</outbound>
</service>
</model>
</mule>
tijs.rademakers (494) [Avatar] Offline
#2
Re: Problem with concurrent CXF requests
Hi Diana,

Interesting. The exception mentions that there are at least two connectors defined matching the http protocol. But in your Mule configuration there's no http connector defined. So I find a very strange that this works with one file, but not with multiple files.
So I think this is a bug. I would advise to create an issue in the JIRA of Mule.

Best regards,

Tijs