[mule-user] RestServiceWrapper fails when handling multiple invocations

4 views
Skip to first unread message

Rune Peter Bjørnstad

unread,
Sep 15, 2007, 4:11:10 PM9/15/07
to us...@mule.codehaus.org
Hi,

I'm experiencing the following stacktrace when I'm sending multiple (5+) events to a RestServiceWrapper component at the same time

INFO  2007-09-15 22:03:21,112 [Stage2UMO.6] org.mule.components.rest.RestServiceWrapper : Invoking REST service: http://localhost/apache2-default/
INFO  2007-09-15 22:03:21,117 [Stage2UMO.8] org.mule.providers.http.HttpConnector: Initialising: HttpConnector{this=58b51c29, started=false, initialised=false, name=' connector.http.0.1', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[http], serviceOverrides=null}
ERROR 2007-09-15 22:03:21,133 [ Stage2UMO.7] org.mule.impl.DefaultComponentExceptionStrategy:
********************************************************************************
Message               : 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)
Type                  : org.mule.providers.service.TransportFactoryException
Code                  : MULE_ERROR--2
JavaDoc               : http://mule.mulesource.org/docs/apidocs/org/mule/providers/service/TransportFactoryException.html
********************************************************************************
Exception stack is:
1. 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)
  org.mule.providers.service.TransportFactory:443 (null)
2. 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) (org.mule.providers.service.TransportFactoryException)
  org.mule.providers.service.TransportFactory:111 ( http://mule.mulesource.org/docs/apidocs/org/mule/providers/service/TransportFactoryException.html)
********************************************************************************
Root Exception stack trace:
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.providers.service.TransportFactory.getConnectorByProtocol(TransportFactory.java:443)
        at org.mule.providers.service.TransportFactory.createEndpoint(TransportFactory.java:101)
        at org.mule.impl.ImmutableMuleEndpoint.createEndpointFromUri (ImmutableMuleEndpoint.java:598)
        at org.mule.impl.ImmutableMuleEndpoint.getOrCreateEndpointForUri(ImmutableMuleEndpoint.java:663)
        at org.mule.impl.MuleEventContext.sendEvent(MuleEventContext.java:280)
        at org.mule.components.rest.RestServiceWrapper.onCall(RestServiceWrapper.java:226)
        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.impl.model.resolvers.DynamicEntryPoint.invokeMethod (DynamicEntryPoint.java:312)
        at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(DynamicEntryPoint.java:259)
        at org.mule.impl.DefaultLifecycleAdapter.intercept(DefaultLifecycleAdapter.java:194)
        at org.mule.impl.InterceptorsInvoker.execute(InterceptorsInvoker.java:47)
        at org.mule.impl.model.DefaultMuleProxy.run(DefaultMuleProxy.java:467)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java :310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java :528)
        at java.lang.Thread.run(Thread.java:619)

********************************************************************************

<mule-descriptor name="Stage2UMO" implementation=" org.mule.components.rest.RestServiceWrapper">
            <inbound-router>
                <global-endpoint name="Stage1"/>
            </inbound-router>
            <outbound-router>
                <router className="org.mule.routing.outbound.OutboundPassThroughRouter">
                    <endpoint address="stream://System.out"/>
                </router>
            </outbound-router>
            <properties>              
                <property name="serviceUrl" value="http://localhost/apache2-default/ "/>
                <property name="payloadParameterName" value="articleId"/>
                <property name="httpMethod" value="GET"/>
            </properties>

        </mule-descriptor>

The components inbound-router listens for files in a directory. Maybe this error is due to misuse of the component, but still, the error message is pretty cryptic for those not into the Mule internals.

Kind Regards,

Rune Peter Bjørnstad.

andrew cooke

unread,
Sep 15, 2007, 4:25:50 PM9/15/07
to us...@mule.codehaus.org

i thought that was one of the better error messages! it usually appears
when you define two different connectors for the same protocol - the
system cannot "guess" which one you want when you create an endpoint.

see, for example,
http://fisheye.codehaus.org/browse/mule/trunk/mule/tests/functional/src/test/resources/multiple-named-connectors-test.xml?r=6743

however, when you describe this as only happening if you send multiple
events then that sounds completely unconnected. my best guesses are:

- your sending system is generating connectors rather than using an
existing connector (ie not using a fixed config, but constructing things
via Java calls), and there is more than one thread involved, so at times
more than one connector exists in the system.

- this is a bug related to threading within mule itself. what version of
mule?

andrew

> (ThreadPoolExecutor.java:528)

---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Andrew Perepelytsya

unread,
Sep 15, 2007, 4:28:22 PM9/15/07
to us...@mule.codehaus.org
Hi Rune Peter,

I see you are using pre 1.4.2/1.4.3 Mule. Could you please try with later version and come up with a reliable way to reproduce a failure? If you would post a full config, there should be other http endpoints which cause the error...

Andrew

Rune Peter Bjørnstad

unread,
Sep 15, 2007, 4:43:14 PM9/15/07
to us...@mule.codehaus.org
Hi Andrew,

I'm actually using Mule 1.4.2. The only relevant part of my configuration is the global inbound endpoint:

<endpoint name="Stage1" address="file:///tmp/mule/podcast-stage1" transformers="NoAction" connector="NonConsumingFileConnector">
  <properties>
    <property name="moveToDirectory" value="/tmp/mule/podcast-stage2"/>
  </properties>
</endpoint>

I simply dumped 5 files into /tmp/mule/podcast/stage1 and the previously defined errors occurs. I don't do any programmatic manipulation of Mule at all. Just one component with one inbound endpoint.  The only connector definition in the config file are two file connectors - no HTTP connectors are mentioned at all. The only two endpoint protocols used are file and stream.

Kind Regards,

Rune Peter Bjørnstad.

Rune Peter Bjørnstad

unread,
Sep 15, 2007, 4:45:29 PM9/15/07
to us...@mule.codehaus.org
As an additional note; I haven't provided any mule-environment-properties element in my config.

On 9/15/07, Rune Peter Bjørnstad < rune...@gmail.com> wrote:
Hi Andrew,

I'm actually using Mule 1.4.2 . The only relevant part of my configuration is the global inbound endpoint:

andrew cooke

unread,
Sep 15, 2007, 5:42:39 PM9/15/07
to us...@mule.codehaus.org

have you tried reducing the number of threads available to Stage2UMO?

i would guess that it's being called in multiple threads and doing the
connector creation (i had a quick look at the code but don't see how it
works in detail, quickly).

andrew

ps sorry, don't know enough to give detailed instructions on configuring
threading off the top of my head.


> As an additional note; I haven't provided any mule-environment-properties
> element in my config.
>
> On 9/15/07, Rune Peter Bjørnstad <rune...@gmail.com> wrote:
>>
>> Hi Andrew,
>>

>> I'm actually using Mule 1.4.2. The only relevant part of my

>> (http://mule.mulesource.org/docs/apidocs/org/mule/providers/service/TransportFactoryException.html


>> > > )
>> > >
>> > > ********************************************************************************
>> > > Root Exception stack trace:
>> > > 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.providers.service.TransportFactory.getConnectorByProtocol(
>> > > TransportFactory.java:443)
>> > > at
>> org.mule.providers.service.TransportFactory.createEndpoint(
>> > > TransportFactory.java:101)
>> > > at org.mule.impl.ImmutableMuleEndpoint.createEndpointFromUri
>> (
>> > > ImmutableMuleEndpoint.java:598)
>> > > at
>> > > org.mule.impl.ImmutableMuleEndpoint.getOrCreateEndpointForUri(
>> > > ImmutableMuleEndpoint.java:663)
>> > > at org.mule.impl.MuleEventContext.sendEvent(
>> > > MuleEventContext.java:280)
>> > > at org.mule.components.rest.RestServiceWrapper.onCall(

>> > > RestServiceWrapper.java:226)
>> > > 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.impl.model.resolvers.DynamicEntryPoint.invokeMethod (

>> > > DynamicEntryPoint.java:312)
>> > > at org.mule.impl.model.resolvers.DynamicEntryPoint.invoke(
>> > > DynamicEntryPoint.java:259)
>> > > at org.mule.impl.DefaultLifecycleAdapter.intercept(
>> > > DefaultLifecycleAdapter.java:194)
>> > > at org.mule.impl.InterceptorsInvoker.execute(
>> > > InterceptorsInvoker.java:47)
>> > > at org.mule.impl.model.DefaultMuleProxy.run(

>> > > DefaultMuleProxy.java:467)
>> > > at
>> org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
>> > > at

>> > > edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker
>> > > (ThreadPoolExecutor.java:987)
>> > > at
>> > > edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run

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

Andrew Perepelytsya

unread,
Sep 15, 2007, 9:41:25 PM9/15/07
to us...@mule.codehaus.org
Rune,

The parameter is payloadParameterNames , note the S at the end, there's no payloadParameterName in 1.4.2, maybe this is the problem, though it leads to a strange error, I admit.

Andrew

Rune Peter Bjørnstad

unread,
Sep 16, 2007, 2:31:48 AM9/16/07
to us...@mule.codehaus.org
Andrew,

I updated to payloadParameterNames and everything works again! Thanks a lot. Though I agree with you; strange error for a malformed configuration :)

Kind Regards,

Rune Peter.
Reply all
Reply to author
Forward
0 new messages