You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tschuler <th...@opentext.com> on 2013/09/12 09:28:35 UTC

ActiveMQ broker stops

Hi!

>From time to time (TomEE may run several days without any problems) the
activeMQ broker stops - following log messages can be found in catalina.log:

Sep 9, 2013 1:38:55 PM org.apache.activemq.store.jdbc.DefaultDatabaseLocker
keepAlive
SEVERE: Failed to update database lock:
com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
	at
com.microsoft.sqlserver.jdbc.TDSCommand.checkForInterrupt(IOBuffer.java:5918)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:70)
	at
com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1510)
	at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
	at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
	at
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
	at
com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
	at
com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
	at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
	at
org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
	at
org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
	at
org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
	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)
Sep 9, 2013 1:38:55 PM org.apache.activemq.broker.LockableServiceSupport
stopBroker
INFO: localhost, no longer able to keep the exclusive lock so giving up
being a master


Is there a TomEE configuration parameter that enforces TomEE to restart a
stopped activeMq broker?
Can we somehow avoid the stopping of the broker as the database was
available all the time?


We are using TomEE 1.6.0 webprofile snapshot (from a few days ago) and add
activeMQ jars to lib directory on our own.

The tomee.xml looks like this:

	
	<Resource id="JmsDS" type="DataSource">
		JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
		JdbcUrl
jdbc:sqlserver://localhost:1433;DatabaseName=TOMEE_TEST;responseBuffering=adaptive
		UserName tomee
		Password tomee
		JtaManaged true
	</Resource>
	<Resource id="JmsResourceAdapter" type="ActiveMQResourceAdapter">
		BrokerXmlConfig
broker:(tcp://localhost:61616)?persistent=true&amp;useJmx=false
		ServerUrl = failover:(tcp://localhost:61616)
		DataSource JmsDS
	</Resource>
	<Resource id="JmsConnectionFactory" type="javax.jms.ConnectionFactory">
		ResourceAdapter = JmsResourceAdapter
	</Resource>
	<Container id="JmsMdbContainer" ctype="MESSAGE">
		ResourceAdapter = JmsResourceAdapter
	</Container>

Best regards,
Thomas



--
View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you reproduce it? Should be doable embedded using an in memory
databse you close (I think to h2 but hsqldb would work)

would allow us to dig into it
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-12 12:42 GMT+01:00 tschuler <th...@opentext.com>:
> No, we do not use JMX.
>
> As described at the very beginning of this topic:
> If the ActiveMQ database locker cannot update database lock, the broker
> shuts down.
> So TomEE is running with stopped ActiveMQ broker.
>
> To avoid this we try to implement a monitoring thread that checks from time
> to time if broker is running.
> If broker is down the monitoring thread should restart the broker again.
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4667710.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by tschuler <th...@opentext.com>.
No, we do not use JMX.

As described at the very beginning of this topic: 
If the ActiveMQ database locker cannot update database lock, the broker
shuts down.
So TomEE is running with stopped ActiveMQ broker.

To avoid this we try to implement a monitoring thread that checks from time
to time if broker is running.
If broker is down the monitoring thread should restart the broker again.

Best regards,
Thomas



--
View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4667710.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you restart through jmx? would be great to know why it doesn't restart
and more why it stops.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-12 12:26 GMT+01:00 tschuler <th...@opentext.com>:
> Hi Romain!
>
> We use TomEE 1.6.0 release and still got the problem that the broker shuts
> down after a few days.
> Is there a way to programmatically restart the broker if it is down using
> the configuration in tomee.xml?
> Actually we observer the broker using BrokerService retrieved from
> ActiveMQ5Factory.
> But starting the broker does not work as expected (brokerService.start(
> true)) as default settings are used.
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4667706.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by tschuler <th...@opentext.com>.
Hi Romain!

We use TomEE 1.6.0 release and still got the problem that the broker shuts
down after a few days.
Is there a way to programmatically restart the broker if it is down using
the configuration in tomee.xml?
Actually we observer the broker using BrokerService retrieved from
ActiveMQ5Factory.
But starting the broker does not work as expected (brokerService.start(
true)) as default settings are used.

Best regards,
Thomas



--
View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4667706.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

If amq is released well ship it
Le 16 sept. 2013 16:53, "tschuler" <th...@opentext.com> a écrit :

> Hi Romain!
>
> Please have a look at:
>
> http://activemq.2283324.n4.nabble.com/Avoid-broker-stop-within-TomEE-tp4671531.html
> and
> https://issues.apache.org/jira/browse/AMQ-4526
>
> Is there a chance to get ActiveMQ 5.9.0 included in TomEE 1.6.0?
> Or is an additional ActiveMQ configuration parameter (in this case
> restartAllowed) available by default?
>
> Best regards,
> Thomas
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665086.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: ActiveMQ broker stops

Posted by tschuler <th...@opentext.com>.
Hi Romain!

Please have a look at:
http://activemq.2283324.n4.nabble.com/Avoid-broker-stop-within-TomEE-tp4671531.html
and
https://issues.apache.org/jira/browse/AMQ-4526

Is there a chance to get ActiveMQ 5.9.0 included in TomEE 1.6.0?
Or is an additional ActiveMQ configuration parameter (in this case
restartAllowed) available by default?

Best regards,
Thomas




--
View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665086.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Look http://commons.apache.org/proper/commons-dbcp/configuration.html (the
block with validationQuery parameter). Just configure your tomee datasource
used by the broker with it.

Maybe AMQ guys would have more inputs if it doesn't help.

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/9/12 tschuler <th...@opentext.com>

> Hi Romain!
>
> As the database runs on the same computer I don't think it's a network
> issue.
> But anyhow, can you give me an example how to use a pool for activemq
> database connections in TomEE?
>
> Best regards,
>                 Thomas
>
>
> Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> ml-node+s979440n4665061h1@n4.nabble.com]
> Gesendet: Donnerstag, 12. September 2013 09:33
> An: Thomas Schuler
> Betreff: Re: ActiveMQ broker stops
>
> Hi
>
> isn't it simply cause you have a network issue between your tomee and the
> database?
>
> this would mean you need to configure the pool to avoid this kind of issue
> (using connection eviction config - see validationquery etc...)
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/9/12 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4665061&i=0>>
>
> > Hi!
> >
> > From time to time (TomEE may run several days without any problems) the
> > activeMQ broker stops - following log messages can be found in
> > catalina.log:
> >
> > Sep 9, 2013 1:38:55 PM
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker
> > keepAlive
> > SEVERE: Failed to update database lock:
> > com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
> > com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.TDSCommand.checkForInterrupt(IOBuffer.java:5918)
> >         at
> com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:70)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1510)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
> >         at
> > com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
> >         at
> >
> >
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
> >         at
> >
> >
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
> >         at
> >
> >
> org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
> >         at
> >
> >
> org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
> >         at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> >         at
> >
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> >         at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> >         at
> >
> >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> >         at
> >
> >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
> >         at
> >
> >
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
> >         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)
> > Sep 9, 2013 1:38:55 PM org.apache.activemq.broker.LockableServiceSupport
> > stopBroker
> > INFO: localhost, no longer able to keep the exclusive lock so giving up
> > being a master
> >
> >
> > Is there a TomEE configuration parameter that enforces TomEE to restart a
> > stopped activeMq broker?
> > Can we somehow avoid the stopping of the broker as the database was
> > available all the time?
> >
> >
> > We are using TomEE 1.6.0 webprofile snapshot (from a few days ago) and
> add
> > activeMQ jars to lib directory on our own.
> >
> > The tomee.xml looks like this:
> >
> >
> >         <Resource id="JmsDS" type="DataSource">
> >                 JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
> >                 JdbcUrl
> >
> >
> jdbc:sqlserver://localhost:1433;DatabaseName=TOMEE_TEST;responseBuffering=adaptive
> >                 UserName tomee
> >                 Password tomee
> >                 JtaManaged true
> >         </Resource>
> >         <Resource id="JmsResourceAdapter" type="ActiveMQResourceAdapter">
> >                 BrokerXmlConfig
> > broker:(tcp://localhost:61616)?persistent=true&amp;useJmx=false
> >                 ServerUrl = failover:(tcp://localhost:61616)
> >                 DataSource JmsDS
> >         </Resource>
> >         <Resource id="JmsConnectionFactory"
> > type="javax.jms.ConnectionFactory">
> >                 ResourceAdapter = JmsResourceAdapter
> >         </Resource>
> >         <Container id="JmsMdbContainer" ctype="MESSAGE">
> >                 ResourceAdapter = JmsResourceAdapter
> >         </Container>
> >
> > Best regards,
> > Thomas
> >
> >
> >
> > --
> > View this message in context:
> > http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665061.html
> To unsubscribe from ActiveMQ broker stops, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665060&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjUwNjB8LTE4NTIyNTQ0OTI=
> >.
> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665062.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

AW: ActiveMQ broker stops

Posted by tschuler <th...@opentext.com>.
Hi Romain!

As the database runs on the same computer I don't think it's a network issue.
But anyhow, can you give me an example how to use a pool for activemq database connections in TomEE?

Best regards,
                Thomas


Von: Romain Manni-Bucau [via OpenEJB] [mailto:ml-node+s979440n4665061h1@n4.nabble.com]
Gesendet: Donnerstag, 12. September 2013 09:33
An: Thomas Schuler
Betreff: Re: ActiveMQ broker stops

Hi

isn't it simply cause you have a network issue between your tomee and the
database?

this would mean you need to configure the pool to avoid this kind of issue
(using connection eviction config - see validationquery etc...)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/9/12 tschuler <[hidden email]</user/SendEmail.jtp?type=node&node=4665061&i=0>>

> Hi!
>
> From time to time (TomEE may run several days without any problems) the
> activeMQ broker stops - following log messages can be found in
> catalina.log:
>
> Sep 9, 2013 1:38:55 PM org.apache.activemq.store.jdbc.DefaultDatabaseLocker
> keepAlive
> SEVERE: Failed to update database lock:
> com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
> com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
>         at
>
> com.microsoft.sqlserver.jdbc.TDSCommand.checkForInterrupt(IOBuffer.java:5918)
>         at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:70)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1510)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
>         at
> com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
>         at
>
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
>         at
>
> org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
>         at
>
> org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
>         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)
> Sep 9, 2013 1:38:55 PM org.apache.activemq.broker.LockableServiceSupport
> stopBroker
> INFO: localhost, no longer able to keep the exclusive lock so giving up
> being a master
>
>
> Is there a TomEE configuration parameter that enforces TomEE to restart a
> stopped activeMq broker?
> Can we somehow avoid the stopping of the broker as the database was
> available all the time?
>
>
> We are using TomEE 1.6.0 webprofile snapshot (from a few days ago) and add
> activeMQ jars to lib directory on our own.
>
> The tomee.xml looks like this:
>
>
>         <Resource id="JmsDS" type="DataSource">
>                 JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
>                 JdbcUrl
>
> jdbc:sqlserver://localhost:1433;DatabaseName=TOMEE_TEST;responseBuffering=adaptive
>                 UserName tomee
>                 Password tomee
>                 JtaManaged true
>         </Resource>
>         <Resource id="JmsResourceAdapter" type="ActiveMQResourceAdapter">
>                 BrokerXmlConfig
> broker:(tcp://localhost:61616)?persistent=true&amp;useJmx=false
>                 ServerUrl = failover:(tcp://localhost:61616)
>                 DataSource JmsDS
>         </Resource>
>         <Resource id="JmsConnectionFactory"
> type="javax.jms.ConnectionFactory">
>                 ResourceAdapter = JmsResourceAdapter
>         </Resource>
>         <Container id="JmsMdbContainer" ctype="MESSAGE">
>                 ResourceAdapter = JmsResourceAdapter
>         </Container>
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665061.html
To unsubscribe from ActiveMQ broker stops, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665060&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjUwNjB8LTE4NTIyNTQ0OTI=>.
NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060p4665062.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: ActiveMQ broker stops

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

isn't it simply cause you have a network issue between your tomee and the
database?

this would mean you need to configure the pool to avoid this kind of issue
(using connection eviction config - see validationquery etc...)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/9/12 tschuler <th...@opentext.com>

> Hi!
>
> From time to time (TomEE may run several days without any problems) the
> activeMQ broker stops - following log messages can be found in
> catalina.log:
>
> Sep 9, 2013 1:38:55 PM org.apache.activemq.store.jdbc.DefaultDatabaseLocker
> keepAlive
> SEVERE: Failed to update database lock:
> com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
> com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
>         at
>
> com.microsoft.sqlserver.jdbc.TDSCommand.checkForInterrupt(IOBuffer.java:5918)
>         at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:70)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1510)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
>         at
> com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
>         at
>
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
>         at
>
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
>         at
>
> org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
>         at
>
> org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
>         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)
> Sep 9, 2013 1:38:55 PM org.apache.activemq.broker.LockableServiceSupport
> stopBroker
> INFO: localhost, no longer able to keep the exclusive lock so giving up
> being a master
>
>
> Is there a TomEE configuration parameter that enforces TomEE to restart a
> stopped activeMq broker?
> Can we somehow avoid the stopping of the broker as the database was
> available all the time?
>
>
> We are using TomEE 1.6.0 webprofile snapshot (from a few days ago) and add
> activeMQ jars to lib directory on our own.
>
> The tomee.xml looks like this:
>
>
>         <Resource id="JmsDS" type="DataSource">
>                 JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
>                 JdbcUrl
>
> jdbc:sqlserver://localhost:1433;DatabaseName=TOMEE_TEST;responseBuffering=adaptive
>                 UserName tomee
>                 Password tomee
>                 JtaManaged true
>         </Resource>
>         <Resource id="JmsResourceAdapter" type="ActiveMQResourceAdapter">
>                 BrokerXmlConfig
> broker:(tcp://localhost:61616)?persistent=true&amp;useJmx=false
>                 ServerUrl = failover:(tcp://localhost:61616)
>                 DataSource JmsDS
>         </Resource>
>         <Resource id="JmsConnectionFactory"
> type="javax.jms.ConnectionFactory">
>                 ResourceAdapter = JmsResourceAdapter
>         </Resource>
>         <Container id="JmsMdbContainer" ctype="MESSAGE">
>                 ResourceAdapter = JmsResourceAdapter
>         </Container>
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ActiveMQ-broker-stops-tp4665060.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>