java.lang.IllegalStateException: There are at least 2 connectors matching protocol "tcp", so the connector to use must be specified on the endpoint using the 'connector' property/attribute

MuleSoft JIRA | Gilles Gosuin | 8 years ago
  1. 0

    Mule throws the following exception when two connectors with the same protocols are defined. java.lang.IllegalStateException: There are at least 2 connectors matching protocol "tcp", 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:168) at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:552) at org.mule.endpoint.AbstractEndpointBuilder.getDefaultConnector(AbstractEndpointBuilder.java:275) at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:270) at org.mule.endpoint.AbstractEndpointBuilder.doBuildOutboundEndpoint(AbstractEndpointBuilder.java:188) 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.routing.outbound.AbstractRecipientList.getRecipientEndpointFromString(AbstractRecipientList.java:184) at org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpoint(AbstractRecipientList.java:143) at org.mule.routing.outbound.AbstractRecipientList.route(AbstractRecipientList.java:87) 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:883) at org.mule.model.seda.SedaService.dispatchToOutboundRouter(SedaService.java:514) at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:537) 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(Unknown Source) I DID define the connector explicitly on the endpoint (see configuration).

    MuleSoft JIRA | 8 years ago | Gilles Gosuin
    java.lang.IllegalStateException: There are at least 2 connectors matching protocol "tcp", so the connector to use must be specified on the endpoint using the 'connector' property/attribute
  2. 0

    Mule throws the following exception when two connectors with the same protocols are defined. java.lang.IllegalStateException: There are at least 2 connectors matching protocol "tcp", 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:168) at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:552) at org.mule.endpoint.AbstractEndpointBuilder.getDefaultConnector(AbstractEndpointBuilder.java:275) at org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:270) at org.mule.endpoint.AbstractEndpointBuilder.doBuildOutboundEndpoint(AbstractEndpointBuilder.java:188) 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.routing.outbound.AbstractRecipientList.getRecipientEndpointFromString(AbstractRecipientList.java:184) at org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpoint(AbstractRecipientList.java:143) at org.mule.routing.outbound.AbstractRecipientList.route(AbstractRecipientList.java:87) 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:883) at org.mule.model.seda.SedaService.dispatchToOutboundRouter(SedaService.java:514) at org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:537) 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(Unknown Source) I DID define the connector explicitly on the endpoint (see configuration).

    MuleSoft JIRA | 8 years ago | Gilles Gosuin
    java.lang.IllegalStateException: There are at least 2 connectors matching protocol "tcp", so the connector to use must be specified on the endpoint using the 'connector' property/attribute
  3. 0

    Mule returning a MessageCollection from component

    Stack Overflow | 3 years ago | Tad
    java.lang.IllegalStateException: Payload was invalidated calling setPayload and the message is not collection anymore.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    With the included test cases you can reproduce the issue for Services and Flows. At startup all is fine. New messages are sent using mule client. Once the seda queue is full and all threads are still busy you can face this issue. When the threadWaitTimeout expires the message is refused. On the exception handling that follows you get the below exception which crashes the service or flow. Under test/resources there are 2 thread dumps, one before and one after the crash. In the second dump you can see that the dispatcher thread "sedaFlowCrash.stage1.01" has effectively died. #### - ERROR 2011-12-21 17:32:34,366 [sedaFlowCrash.stage1.01] org.mule.exception.DefaultMessagingExceptionStrategy: Caught exception in Exception Strategy: ThreadPoolExecutor did not accept within 500 MILLISECONDS java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor did not accept within 500 MILLISECONDS at org.mule.util.concurrent.WaitPolicy.rejectedExecution(WaitPolicy.java:62) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) at org.mule.work.ScheduleWorkExecutor.doExecute(ScheduleWorkExecutor.java:41) at org.mule.work.MuleWorkManager.executeWork(MuleWorkManager.java:250) at org.mule.work.MuleWorkManager.scheduleWork(MuleWorkManager.java:218) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:233) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) #### - WARN 2011-12-21 17:32:34,378 [sedaFlowCrash.stage1.01] org.mule.DefaultMuleMessage: Message access violation java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main] at org.mule.DefaultMuleMessage.newException(DefaultMuleMessage.java:1574) at org.mule.DefaultMuleMessage.checkMutable(DefaultMuleMessage.java:1560) at org.mule.DefaultMuleMessage.assertAccess(DefaultMuleMessage.java:1489) at org.mule.DefaultMuleMessage.setExceptionPayload(DefaultMuleMessage.java:993) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:60) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:66) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:239) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) #### - ERROR 2011-12-21 17:32:34,383 [sedaFlowCrash.stage1.01] org.mule.processor.AsyncWorkListener: Work caused exception on 'workCompleted'. Work being executed was: org.mule.processor.SedaStageInterceptingMessageProcessor Exception in thread "sedaFlowCrash.stage1.01" org.mule.api.MuleRuntimeException: An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of 'sedaFlowCrash' processor chain' [ DefaultJavaComponent{sedaFlowCrash.commponent.1821889520}, DefaultOutboundEndpoint{endpointUri=vm://flow.out, connector=VMConnector { name=connector.VM.mule.default lifecycle=start this=63fb050c numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=true connected=true supportedProtocols=[vm] serviceOverrides=<none> } , name='endpoint.vm.flow.out', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}, org.mule.routing.requestreply.AsyncReplyToPropertyRequestReplyReplier ]" for asynchronously. at org.mule.processor.AsyncWorkListener.handleWorkException(AsyncWorkListener.java:74) at org.mule.processor.AsyncWorkListener.workCompleted(AsyncWorkListener.java:50) at org.mule.work.WorkerContext.run(WorkerContext.java:369) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main] at org.mule.DefaultMuleMessage.newException(DefaultMuleMessage.java:1574) at org.mule.DefaultMuleMessage.checkMutable(DefaultMuleMessage.java:1560) at org.mule.DefaultMuleMessage.assertAccess(DefaultMuleMessage.java:1489) at org.mule.DefaultMuleMessage.setExceptionPayload(DefaultMuleMessage.java:993) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:60) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:66) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:239) at org.mule.work.WorkerContext.run(WorkerContext.java:310) ... 3 more

    MuleSoft JIRA | 5 years ago | Jeroen Verellen
    java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main]
  6. 0

    With the included test cases you can reproduce the issue for Services and Flows. At startup all is fine. New messages are sent using mule client. Once the seda queue is full and all threads are still busy you can face this issue. When the threadWaitTimeout expires the message is refused. On the exception handling that follows you get the below exception which crashes the service or flow. Under test/resources there are 2 thread dumps, one before and one after the crash. In the second dump you can see that the dispatcher thread "sedaFlowCrash.stage1.01" has effectively died. #### - ERROR 2011-12-21 17:32:34,366 [sedaFlowCrash.stage1.01] org.mule.exception.DefaultMessagingExceptionStrategy: Caught exception in Exception Strategy: ThreadPoolExecutor did not accept within 500 MILLISECONDS java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor did not accept within 500 MILLISECONDS at org.mule.util.concurrent.WaitPolicy.rejectedExecution(WaitPolicy.java:62) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) at org.mule.work.ScheduleWorkExecutor.doExecute(ScheduleWorkExecutor.java:41) at org.mule.work.MuleWorkManager.executeWork(MuleWorkManager.java:250) at org.mule.work.MuleWorkManager.scheduleWork(MuleWorkManager.java:218) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:233) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) #### - WARN 2011-12-21 17:32:34,378 [sedaFlowCrash.stage1.01] org.mule.DefaultMuleMessage: Message access violation java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main] at org.mule.DefaultMuleMessage.newException(DefaultMuleMessage.java:1574) at org.mule.DefaultMuleMessage.checkMutable(DefaultMuleMessage.java:1560) at org.mule.DefaultMuleMessage.assertAccess(DefaultMuleMessage.java:1489) at org.mule.DefaultMuleMessage.setExceptionPayload(DefaultMuleMessage.java:993) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:60) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:66) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:239) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) #### - ERROR 2011-12-21 17:32:34,383 [sedaFlowCrash.stage1.01] org.mule.processor.AsyncWorkListener: Work caused exception on 'workCompleted'. Work being executed was: org.mule.processor.SedaStageInterceptingMessageProcessor Exception in thread "sedaFlowCrash.stage1.01" org.mule.api.MuleRuntimeException: An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of 'sedaFlowCrash' processor chain' [ DefaultJavaComponent{sedaFlowCrash.commponent.1821889520}, DefaultOutboundEndpoint{endpointUri=vm://flow.out, connector=VMConnector { name=connector.VM.mule.default lifecycle=start this=63fb050c numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=true connected=true supportedProtocols=[vm] serviceOverrides=<none> } , name='endpoint.vm.flow.out', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}, org.mule.routing.requestreply.AsyncReplyToPropertyRequestReplyReplier ]" for asynchronously. at org.mule.processor.AsyncWorkListener.handleWorkException(AsyncWorkListener.java:74) at org.mule.processor.AsyncWorkListener.workCompleted(AsyncWorkListener.java:50) at org.mule.work.WorkerContext.run(WorkerContext.java:369) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main] at org.mule.DefaultMuleMessage.newException(DefaultMuleMessage.java:1574) at org.mule.DefaultMuleMessage.checkMutable(DefaultMuleMessage.java:1560) at org.mule.DefaultMuleMessage.assertAccess(DefaultMuleMessage.java:1489) at org.mule.DefaultMuleMessage.setExceptionPayload(DefaultMuleMessage.java:993) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:60) at org.mule.exception.AbstractMessagingExceptionStrategy.handleException(AbstractMessagingExceptionStrategy.java:66) at org.mule.processor.SedaStageInterceptingMessageProcessor.run(SedaStageInterceptingMessageProcessor.java:239) at org.mule.work.WorkerContext.run(WorkerContext.java:310) ... 3 more

    MuleSoft JIRA | 5 years ago | Jeroen Verellen
    java.lang.IllegalStateException: Only owner thread can write to message: Thread[connector.VM.mule.default.receiver.03,5,main]/Thread[sedaFlowCrash.stage1.01,5,main]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      There are at least 2 connectors matching protocol "tcp", so the connector to use must be specified on the endpoint using the 'connector' property/attribute

      at org.mule.transport.service.TransportFactory.getConnectorByProtocol()
    2. Mule Core
      WorkerContext.run
      1. org.mule.transport.service.TransportFactory.getConnectorByProtocol(TransportFactory.java:168)
      2. org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:552)
      3. org.mule.endpoint.AbstractEndpointBuilder.getDefaultConnector(AbstractEndpointBuilder.java:275)
      4. org.mule.endpoint.AbstractEndpointBuilder.getConnector(AbstractEndpointBuilder.java:270)
      5. org.mule.endpoint.AbstractEndpointBuilder.doBuildOutboundEndpoint(AbstractEndpointBuilder.java:188)
      6. org.mule.endpoint.AbstractEndpointBuilder.buildOutboundEndpoint(AbstractEndpointBuilder.java:95)
      7. org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultEndpointFactory.java:86)
      8. org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultEndpointFactory.java:62)
      9. org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpointFromString(AbstractRecipientList.java:184)
      10. org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpoint(AbstractRecipientList.java:143)
      11. org.mule.routing.outbound.AbstractRecipientList.route(AbstractRecipientList.java:87)
      12. org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:64)
      13. org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
      14. org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:69)
      15. org.mule.service.AbstractService.dispatchToOutboundRouter(AbstractService.java:883)
      16. org.mule.model.seda.SedaService.dispatchToOutboundRouter(SedaService.java:514)
      17. org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.java:537)
      18. org.mule.work.WorkerContext.run(WorkerContext.java:310)
      18 frames
    3. Backport of JSR 166
      ThreadPoolExecutor$Worker.run
      1. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
      2. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
      2 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame