activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: ActiveMQ 5.2.0 - Problem starting a BrokerService programmatically.
Date Thu, 02 Apr 2009 16:53:32 GMT
On Thu, Apr 2, 2009 at 10:48 AM, virtualshock <nabble@virtualshock.net> wrote:
>
> I am running ActiveMQ embedded in another application and it seems like it is
> running correctly but broker.start() never returns which is hanging the
> startup of my program.  In 4.x I didn't have this problem.
> Here is a code snippet of how I am starting ActiveMQ :
>
>            broker = new BrokerService();
>            broker.setBrokerName(getInternalConnectionName());
>            broker.getManagementContext().setCreateConnector(false);
>            broker.setPersistent(true);
>            broker.addConnector(getExternalConnectionURL());
>            broker.start();
>
> Here is the log output :
>
> 2009-04-02 11:14:42,884 [WrapperListener_start_runner] DEBUG
> com.xxxx.agents.ActiveMQAgent - Starting ActiveMQAgent:tcp://localhost:61616
> & vm://embeddedActiveMQBroker
> 2009-04-02 11:14:42,885 [WrapperListener_start_runner] INFO
> org.apache.activemq.broker.BrokerService - Using Persistence Adapter:
> AMQPersistenceAdapter(activemq-data/embeddedActiveMQBroker)
> 2009-04-02 11:14:42,885 [WrapperListener_start_runner] WARN
> org.apache.activemq.store.amq.AMQPersistenceAdapter - Waiting to Lock the
> Store activemq-data/embeddedActiveMQBroker

Looks like the problem is above. There must be a lock on the data
directory that hasn't been removed. Do you have more than one broker
pointed at the same data directory? If so, this is correct
functionality and is known as shared filesystem master/slave:

http://activemq.apache.org/shared-file-system-master-slave.html

If you don't have another broker pointed at the same data directory,
then it sounds like there might be a stale lock on the data directory.
You can manually locate the lock file and remove it or you can delete
the data directory completely and ActiveMQ will create a new data
directory upon restart.

Make sure that you're shutting down the broker using the
BrokerService.stop() method?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.apache.org/
Apache Camel - http://camel.apache.org/
Apache ServiceMix - http://servicemix.apache.org/

Blog: http://bruceblog.org/

Mime
View raw message