[mule-user] Failed to borrow object from pool

1 view
Skip to first unread message

Po Cheung

unread,
Apr 9, 2007, 3:01:32 PM4/9/07
to us...@mule.codehaus.org

I got the following exception when I tried to set the maxThreadsActive to 1
in the threading profile of a UMO.

********************************************************************************
Message : Failed to borrow object from pool. Component that
caused exception is: TagService. Message payload is of type:
org.apache.activemq.command.ActiveMQObjectMessage
Type : org.mule.umo.ComponentException
Code : MULE_ERROR-79999
JavaDoc :
http://mule.codehaus.org/docs/apidocs/org/mule/umo/ComponentException.html
Payload : ActiveMQObjectMessage {commandId = 13,
responseRequired = true, messageId =
ID:localhost.localdomain-32933-1176143756432-1:0:4:1:1, originalDestination
= null, originalTransactionId = null, producerId =
ID:localhost.localdomain-32933-1176143756432-1:0:4:1, destination =
queue://setTag.queue, transactionId = null, expiration = 0, timestamp =
1176143757285, arrival = 0, correlationId =
ID:localhost.localdomain-32860-1176142273461-1:0:14:1:1, replyTo = null,
persistent = true, type = null, priority = 4, groupID = null, groupSequence
= 0, targetConsumerId = null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@9acb5, marshalledProperties =
org.apache.activemq.util.ByteSequence@29bea3, dataStructure = null,
redeliveryCounter = 0, size = 0, properties =
{MULE_CORRELATION_ID=ID:localhost.localdomain-32860-1176142273461-1:0:14:1:1,
MULE_SESSION=SUQ9NmQwOTU0ZDMtZTZjNy0xMWRiLTgyNzctODE4NzUxN2NiNDhhO0lEPTZkMDk1NGQzLWU2YzctMTFkYi04Mjc3LTgxODc1MTdjYjQ4YQ==,
MULE_ENDPOINT=jms://setTag.queue}, readOnlyProperties = true, readOnlyBody =
true, droppable = false}
********************************************************************************
Exception stack is:
1. null
(edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException)
org.mule.util.concurrent.WaitPolicy:55 (null)
2. Failed to borrow object from pool. Component that caused exception is:
TagService. Message payload is of type:
org.apache.activemq.command.ActiveMQObjectMessage
(org.mule.umo.ComponentException)
org.mule.impl.model.seda.SedaComponent:476
(http://mule.codehaus.org/docs/apidocs/org/mule/umo/ComponentException.html)
********************************************************************************
Root Exception stack trace:
edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException
at
org.mule.util.concurrent.WaitPolicy.rejectedExecution(WaitPolicy.java:55)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:407)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:880)
at
org.mule.impl.work.WorkExecutorPoolImpl.execute(WorkExecutorPoolImpl.java:98)
at
org.mule.impl.work.ScheduleWorkExecutor.doExecute(ScheduleWorkExecutor.java:45)
at org.mule.impl.work.MuleWorkManager.executeWork(MuleWorkManager.java:272)
at
org.mule.impl.work.MuleWorkManager.scheduleWork(MuleWorkManager.java:256)
at org.mule.impl.model.seda.SedaComponent.run(SedaComponent.java:434)
at org.mule.impl.work.WorkerContext.run(WorkerContext.java:301)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:534)

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

Here is the mule-config entry for the UMO:

<mule-descriptor name="TagService" singleton="true"
implementation="com.mathon.is.service.TagServiceImpl">
<inbound-router>
<endpoint address="TagService">
<transaction action="ALWAYS_BEGIN"

factory="org.mule.providers.jms.JmsTransactionFactory"/>
</endpoint>
</inbound-router>
<threading-profile maxThreadsActive="1"/>
</mule-descriptor>

And the JMSConnector where the threading profile also has maxThreadsActive
equal to 1.

<connector name="jmsConnector"
className="org.mule.providers.jms.JmsConnector">
<properties>
<property name="connectionFactoryJndiName"
value="ConnectionFactory"/>
<property name="jndiInitialFactory"

value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
<property name="specification" value="1.1"/>
</properties>
<threading-profile maxThreadsActive="1"/>
</connector>

I would like to have the UMO behave as a singleton so that only a single
instance is created and only one active thread runs to receive a message
from the JMS queue. Is there anything wrong with such a configuration?

Thanks,
Po

--
View this message in context: http://www.nabble.com/Failed-to-borrow-object-from-pool-tf3548958.html#a9907581
Sent from the Mule - User mailing list archive at Nabble.com.


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

http://xircles.codehaus.org/manage_email

Andrew Perepelytsya

unread,
Apr 9, 2007, 3:15:05 PM4/9/07
to us...@mule.codehaus.org
Are there any other jms receivers/dispatchers in the same config?

Andrew

Holger Hoffstätte

unread,
Apr 9, 2007, 3:27:00 PM4/9/07
to us...@mule.codehaus.org

Kunal Khosla

unread,
Apr 9, 2007, 3:29:01 PM4/9/07
to us...@mule.codehaus.org

I tried the same thing. Tried lots of combinations with the pooling profile and threading profile…

 

Setting the threading to ‘1’ gives this exception, setting it to something more than ‘1’ was not an option for us. Had to change our approach finally… this thing doesn’t work unless there was something I missed…

 

-Kunal


***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Po Cheung

unread,
Apr 9, 2007, 4:12:04 PM4/9/07
to us...@mule.codehaus.org

There are no other receivers/dispatchers in the same config. Here is the
complete http://www.nabble.com/file/7774/mule-config.xml mule-config.xml .

Here is how the message flow works:
- Client 1 dispatches a message to each of queue A, B, and C.
- Client 2 processes a message on queue A and dispatches another message to
queue D.
- Client 3 processes a message on queue B and dispatches another message to
queue D.
- Client 4 processes a message on queue C and dispatches another message to
queue D.
- Client 1 processes messages on queue D.

The mule-config.xml is for Client 1 and queue D is setTag.queue.

Hope this helps,
Po


Andrew Perepelytsya wrote:
>
> Are there any other jms receivers/dispatchers in the same config?
>
> Andrew
>
>

--
View this message in context: http://www.nabble.com/Failed-to-borrow-object-from-pool-tf3548958.html#a9908721

Andrew Perepelytsya

unread,
Apr 9, 2007, 4:31:41 PM4/9/07
to us...@mule.codehaus.org
There is an extra jms dispatcher for the exception strategy in your config.

Try configuring the pooling profile on your component.

Andrew

Po Cheung

unread,
Apr 9, 2007, 5:36:04 PM4/9/07
to us...@mule.codehaus.org

Thanks. That does resolve the problem.

--
View this message in context: http://www.nabble.com/Failed-to-borrow-object-from-pool-tf3548958.html#a9910022


Sent from the Mule - User mailing list archive at Nabble.com.

Po Cheung

unread,
Apr 9, 2007, 8:01:29 PM4/9/07
to us...@mule.codehaus.org

I configured the component as follows and it was failing with the same error.
Notice that the transaction was set to NONE for some other reasons.
However, when I changed the transaction to ALWAYS_BEGIN, it all worked.

<mule-descriptor name="TagService"


implementation="com.mathon.is.service.TagServiceImpl">
<inbound-router>
<endpoint address="TagService">

<transaction action="NONE"



factory="org.mule.providers.jms.JmsTransactionFactory"/>
</endpoint>
</inbound-router>

<threading-profile maxThreadsActive="1" maxThreadsIdle="1"/>
<pooling-profile maxActive="1"
initialisationPolicy="INITIALISE_ALL"/>
</mule-descriptor>

I have also tried the same threading and pooling profile and commenting out
the exception strategy and transaction factory but that gave the same error
as well. It seems that the singleton configuration only works for a
component executed within a JMS transaction? Is there any way to make it to
work outside of a tranaction?

Po

--
View this message in context: http://www.nabble.com/Failed-to-borrow-object-from-pool-tf3548958.html#a9911699

Reply all
Reply to author
Forward
0 new messages