what is the Root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

what is the Root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the Root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the toot cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

Filippo Balicchia
In reply to this post by venkatesh
Hi Venkatesh,
Did you try to increase the maximum number tcp/ip connections ?
What OS you are using ?


Regards

--Filippo

2014-09-10 9:10 GMT+02:00 venkatesh <[hidden email]>:

> Hi All,
>
> As i am getting below error when JMS getting stopped automatically with the
> following error(It's happened twice as of now and that too only one day in
> business time). We are using Tomcat server in our application
>
> javax.jms.JMSException: No buffer space available (maximum connections
> reached?): connect
>                 at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
>                 at
> org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1255)
>                 at
> org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1350)
>                 at
> org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:300)
>                 at
> com.spacetimeinsight.alerts.util.MessagingUtils.sendMessage(Unknown Source)
>                 at
> com.spacetimeinsight.alerts.util.MessagingUtils.sendTextMessage(Unknown
> Source)
>                 at
> com.spacetimeinsight.alerts.utils.AlertUtils.sendAutoAcknowledgeMsg(Unknown
> Source)
>                 at
> com.spacetimeinsight.alerts.utils.AlertUtils.processAlertAutoAck(Unknown
> Source)
>
>
> We know work around would be, we need to restart the JMS but if this happens
> every time in business timings then it might be a big problem for us.
>
> So can any one help me to understand the issue in detail for my questions
> below.
>
> 1)what would be root cause for the issue.
> 2)In what scenario's this situation raises
> 3)what would be our precautions to avoid this error.
> 4) what suggestions we can provide to getrid of this error
>
> Please suggest asap which helps me alot
>
> Thanks in advance...
>
> Regards,
> Venkatesh
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/what-is-the-toot-cause-and-how-to-resolve-the-error-i-e-javax-jms-JMSException-No-buffer-space-avail-tp4685440.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

Tim Bain
The standard answer to this is that you're failing to close connections to
the broker, so you eventually run out.  We're not going to be able to track
down why that's happening since it's your code, but you should be able to
figure it out with the help of a debugger.

On Wed, Sep 17, 2014 at 1:06 AM, venkatesh <[hidden email]>
wrote:

> Please help me on this issue if any one have answers
>
> Thanks,
> Venkatesh
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/what-is-the-Root-cause-and-how-to-resolve-the-error-i-e-javax-jms-JMSException-No-buffer-space-avail-tp4685440p4685624.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

Tim Bain
You could start by doing code inspection and looking to see if there is any
code path where you could fail to close a connection once you open it,
which wouldn't require access to the customer environment.

Was there anything unusual in the logs around the time the errors were seen?

Finally, your stack trace from several days ago shows that
com.spacetimeinsight.alerts.util.MessagingUtils.sendMessage() calls
org.apache.activemq.ActiveMQConnection.createSession().  Do you create a
new AMQ session for every message you send?  Is there any caching/pooling
being done?  If you're starting a new connection for each message, that
seems like an easy way to run out of connections if there was a sudden
flurry of messages all at once...  (It's also less efficient than pooling,
so you'd get worse throughput if that's what you're doing.)

Tim

On Thu, Sep 18, 2014 at 6:10 AM, venkatesh <[hidden email]>
wrote:

> Hello,
>
> This is happening in customer end and not in our local system to debug
> here.
> This is happened only once and issue got resolved when customer restarted
> their server.
>
> But my asking is, What information i can gather from customer and what
> customer needs to check at his end if this situation raises again in
> future.
>
> regards,
> Venkatesh
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/what-is-the-Root-cause-and-how-to-resolve-the-error-i-e-javax-jms-JMSException-No-buffer-space-avail-tp4685440p4685691.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

venkatesh
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: what is the root cause and how to resolve the error i.e javax.jms.JMSException: No buffer space available (maximum connections reached?

Tim Bain
The fact that you create a new ActiveMQ connection for each message seems
like the probable cause for the error you saw.  If you had a surge of N
messages to process all at once, you'd have N connections open (I'm
assuming you're processing your messages asynchronously), so if N was large
enough, you could overrun the limit for the number of concurrent
connections.

The Spring page <http://activemq.apache.org/spring-support.html> of the
ActiveMQ documentation recommends using a pooled connection factory
(org.apache.activemq.pool.PooledConnectionFactory) when working with
Spring's JmsTemplate, and I would think you'd want to do the same.  (Maybe
you'd also want to use Spring's JmsTemplate, too?)  I haven't used ActiveMQ
without the support of another framework (Spring or Camel), so I don't have
concrete tips for exactly how to use a PooledConnectionFactory, but
hopefully the page I linked plus what you find from Googling will give you
enough to figure it out.

Tim

On Tue, Sep 23, 2014 at 12:06 AM, venkatesh <[hidden email]>
wrote:

> Hi Tim,
>
> Please find more details related to this issue and also answers for your
> below questions
>
> Your Question: Was there anything unusual in the logs around the time the
> errors were seen?
> Answer: Actually No, But there is one scenario during our performance test
> where this issue occurs but it's not a valid scenario
>
> Your Question: Finally, your stack trace from several days ago shows that
> com.spacetimeinsight.alerts.util.MessagingUtils.sendMessage() calls
> org.apache.activemq.ActiveMQConnection.createSession().
>
> Answer: Please find below code snippet once.
> try {
>                         ConnectionFactory connectionFactory =
> (ConnectionFactory)
> JNDIUtils.getJNDIResouceSource(resourceName);
>                         connection = connectionFactory.createConnection();
>                         Session session = connection.createSession(false,
> Session.CLIENT_ACKNOWLEDGE);
>                         connection.start();
>                         MessageProducer producer =
> session.createProducer((Destination)
> JNDIUtils.getJNDIResouceSource(destinationName));
>                         producer.send(buildMessage(msg, msgType,
> session,props));
>                 } catch (Exception e) {
>                         //some code here
>                 } finally {
>                         if (connection != null) {
>                                 try {
>                                         connection.close();
>                                 } catch (JMSException e) {
>                                         // TODO Auto-generated catch block
>                                         Logger.error("Exception is
> sendMessage  while close connection ",
> MessagingUtils.class, e);
>                                 }
>                         }
>
> Question: Do you create a new AMQ session for every message you send?
> Answer: Yes
>
> Question: Is there any caching/pooling being done?
> Answer: No
>
>
> Thanks,
> Venkatesh
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/what-is-the-Root-cause-and-how-to-resolve-the-error-i-e-javax-jms-JMSException-No-buffer-space-avail-tp4685440p4685778.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>