Hi there, I'm new to activeMQ 4.1.1 and trying to get it set up in our development box, where it must run as an NT service. I've used the TanukiSoftware wrapper before, so I was familiar with the process and had no problems. My trouble started when I started trying to configure activeMQ security. I quickly discovered that many of the examples on configuring the SimpleAuthorizationPlugin and so forth have some hidden gotchas. So, I was doing alot of changes to the conf/activemq.xml and restarting of the service. I finally found an example that I could get to work using the JAAS plugin. Hooray! I then edited the config file again, because my goal was to end up with three different users, each with three different roles: admins, producers, and consumers. I added some stuff to the config file and restarted but then noticed that I was unable to connect at all. I couldn't figure out what might have gone wrong, so I began commenting stuff out of the config file to try to get back to my starting point. However the problem persisted.
Eventually, I noticed that it was hanging on the line in the log that says: INFO DefaultDatabaseLocker - Attempting to acquire the exclusive lock to become the Master broker I researched this error on the net, but found nothing that helped so I gave up for a while. When I came back later to resume troubleshooting I then noticed that everything was fine. It apparently took about an hour or so for whatever was preventing it from acquiring the exclusive lock to go away. I restarted again and noticed that the same problem occurred. You can see this clearly in the log below. This time it took a couple of hours to acquire the exclusive lock. So, my only theory at this point is that the stop of the service is failing to get rid of everything; that something is hanging on through the restart of the service that keeps it from acquiring the exclusive lock. I've studied the task manager trying to see what that could be, but it eludes me. There's no two occurences of the wrapper.exe or java.exe. Not sure what it could be. Here's the wrapper.log: STATUS | wrapper | 2007/10/02 16:26:42 | --> Wrapper Started as Service STATUS | wrapper | 2007/10/02 16:26:42 | Launching a JVM... INFO | jvm 1 | 2007/10/02 16:26:42 | Wrapper (Version 3.2.0) http://wrapper.tanukisoftware.org INFO | jvm 1 | 2007/10/02 16:26:42 | INFO | jvm 1 | 2007/10/02 16:26:43 | ACTIVEMQ_HOME: C:\apache-activemq-4.1.1\bin\win32\..\.. INFO | jvm 1 | 2007/10/02 16:26:43 | ACTIVEMQ_BASE: C:\apache-activemq-4.1.1\bin\win32\..\.. INFO | jvm 1 | 2007/10/02 16:26:43 | Loading message broker from: xbean:activemq.xml INFO | jvm 1 | 2007/10/02 16:26:44 | Created MBeanServer with ID: 7eb366:115629d1d92:-8000:HASSATD-CZJQW41:1 INFO | jvm 1 | 2007/10/02 16:26:45 | INFO BrokerService - ActiveMQ 4.1.1 JMS Message Broker (localhost) is starting INFO | jvm 1 | 2007/10/02 16:26:45 | INFO BrokerService - For help or more information please see: http://incubator.apache.org/activemq/ INFO | jvm 1 | 2007/10/02 16:26:45 | RMIConnectorServer started at: service:jmx:rmi://hassatd-czjqw41/jndi/rmi://localhost:1099/jmxrmi INFO | jvm 1 | 2007/10/02 16:26:45 | INFO ManagementContext - JMX consoles can connect to service:jmx:rmi://hassatd-czjqw41/jndi/rmi://localhost:1099/jmxrmi INFO | jvm 1 | 2007/10/02 16:26:45 | INFO JDBCPersistenceAdapter - Database driver recognized: [oracle_jdbc_driver] INFO | jvm 1 | 2007/10/02 16:26:45 | INFO DefaultDatabaseLocker - Attempting to acquire the exclusive lock to become the Master broker INFO | jvm 1 | 2007/10/02 17:31:08 | INFO DefaultDatabaseLocker - Becoming the master on dataSource: [EMAIL PROTECTED] INFO | jvm 1 | 2007/10/02 17:31:09 | INFO JournalPersistenceAdapter - Journal Recovery Started from: Active Journal: using 5 x 20.0 Megs at: C:\apache-activemq-4.1.1\bin\activemq-data\journal INFO | jvm 1 | 2007/10/02 17:31:09 | INFO JournalPersistenceAdapter - Journal Recovered: 0 message(s) in transactions recovered. INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportServerThreadSupport - Listening for connections at: tcp://HASSATD-CZJQW41:61616 INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportConnector - Connector openwire Started INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportServerThreadSupport - Listening for connections at: ssl://HASSATD-CZJQW41:61617 INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportConnector - Connector ssl Started INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportServerThreadSupport - Listening for connections at: stomp://HASSATD-CZJQW41:61613 INFO | jvm 1 | 2007/10/02 17:31:09 | INFO TransportConnector - Connector stomp Started INFO | jvm 1 | 2007/10/02 17:31:09 | INFO NetworkConnector - Network Connector default-nc Started INFO | jvm 1 | 2007/10/02 17:31:09 | INFO BrokerService - ActiveMQ JMS Message Broker (localhost, ID:HASSATD-CZJQW41-1324-1191360404084-1:0) started INFO | jvm 1 | 2007/10/02 17:44:45 | INFO BrokerService - ActiveMQ Message Broker (localhost, ID:HASSATD-CZJQW41-1324-1191360404084-1:0) is shutting down INFO | jvm 1 | 2007/10/02 17:44:45 | INFO NetworkConnector - Network Connector default-nc Stopped STATUS | wrapper | 2007/10/02 17:44:45 | <-- Wrapper Stopped STATUS | wrapper | 2007/10/02 17:44:46 | --> Wrapper Started as Service STATUS | wrapper | 2007/10/02 17:44:46 | Launching a JVM... INFO | jvm 1 | 2007/10/02 17:44:47 | Wrapper (Version 3.2.0) http://wrapper.tanukisoftware.org INFO | jvm 1 | 2007/10/02 17:44:47 | INFO | jvm 1 | 2007/10/02 17:44:47 | ACTIVEMQ_HOME: C:\apache-activemq-4.1.1\bin\win32\..\.. INFO | jvm 1 | 2007/10/02 17:44:47 | ACTIVEMQ_BASE: C:\apache-activemq-4.1.1\bin\win32\..\.. INFO | jvm 1 | 2007/10/02 17:44:47 | Loading message broker from: xbean:activemq.xml INFO | jvm 1 | 2007/10/02 17:44:49 | Created MBeanServer with ID: 10ab09f:11562e4982d:-8000:HASSATD-CZJQW41:1 INFO | jvm 1 | 2007/10/02 17:44:49 | INFO BrokerService - ActiveMQ 4.1.1 JMS Message Broker (localhost) is starting INFO | jvm 1 | 2007/10/02 17:44:49 | INFO BrokerService - For help or more information please see: http://incubator.apache.org/activemq/ INFO | jvm 1 | 2007/10/02 17:44:49 | RMIConnectorServer started at: service:jmx:rmi://hassatd-czjqw41/jndi/rmi://localhost:1099/jmxrmi INFO | jvm 1 | 2007/10/02 17:44:49 | INFO ManagementContext - JMX consoles can connect to service:jmx:rmi://hassatd-czjqw41/jndi/rmi://localhost:1099/jmxrmi INFO | jvm 1 | 2007/10/02 17:44:50 | INFO JDBCPersistenceAdapter - Database driver recognized: [oracle_jdbc_driver] INFO | jvm 1 | 2007/10/02 17:44:50 | INFO DefaultDatabaseLocker - Attempting to acquire the exclusive lock to become the Master broker INFO | jvm 1 | 2007/10/02 19:42:06 | INFO DefaultDatabaseLocker - Becoming the master on dataSource: [EMAIL PROTECTED] INFO | jvm 1 | 2007/10/02 19:42:06 | INFO JournalPersistenceAdapter - Journal Recovery Started from: Active Journal: using 5 x 20.0 Megs at: C:\apache-activemq-4.1.1\bin\activemq-data\journal INFO | jvm 1 | 2007/10/02 19:42:06 | INFO JournalPersistenceAdapter - Journal Recovered: 1 message(s) in transactions recovered. INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportServerThreadSupport - Listening for connections at: tcp://HASSATD-CZJQW41:61616 INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportConnector - Connector openwire Started INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportServerThreadSupport - Listening for connections at: ssl://HASSATD-CZJQW41:61617 INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportConnector - Connector ssl Started INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportServerThreadSupport - Listening for connections at: stomp://HASSATD-CZJQW41:61613 INFO | jvm 1 | 2007/10/02 19:42:07 | INFO TransportConnector - Connector stomp Started INFO | jvm 1 | 2007/10/02 19:42:07 | INFO NetworkConnector - Network Connector default-nc Started INFO | jvm 1 | 2007/10/02 19:42:07 | INFO BrokerService - ActiveMQ JMS Message Broker (localhost, ID:HASSATD-CZJQW41-1394-1191365088496-1:0) started And, here is the contents of my activemq.xml configuration file. I should be back at my original config file here with all the security stuff commented out, but you can see where I was trying to go with this: <beans> <!-- Allows us to use system properties as variables in this configuration file --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <broker brokerName="localhost" useJmx="true" xmlns="http://activemq.org/config/1.0"> <!-- Use the following to set the broker memory limit <memoryManager> <usageManager id="memory-manager" limit="20 MB"/> </memoryManager> --> <!-- Use the following to configure how ActiveMQ is exposed in JMX <managementContext> <managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/> </managementContext> --> <!-- Queue setup. Queues can be created on the fly by any user with admin rights, but it is not good to give every user admin rights. --> <!-- <destinations> <queue physicalName="RPTQ.DEFAULT" /> <queue physicalName="RPTQ.RUBY" /> </destinations> --> <plugins> <!-- use JAAS to authenticate using the login.config file on the classpath to configure JAAS --> <!-- <jaasAuthenticationPlugin configuration="activemq-domain" /> --> <!-- lets configure a destination based authorization mechanism --> <!-- <authorizationPlugin> <map> <authorizationMap> <authorizationEntries> <authorizationEntry queue="RPTQ.DEFAULT" read="consumers,admins" write="producers,admins" admin="admins" /> <authorizationEntry queue="RPTQ.RUBY" read="consumers,admins" write="producers,admins" admin="admins" /> </authorizationEntries> </authorizationMap> </map> </authorizationPlugin> --> </plugins> <!-- In ActiveMQ 4, you can setup destination policies --> <destinationPolicy> <policyMap><policyEntries> <policyEntry topic="FOO.>"> <dispatchPolicy> <strictOrderDispatchPolicy /> </dispatchPolicy> <subscriptionRecoveryPolicy> <lastImageSubscriptionRecoveryPolicy /> </subscriptionRecoveryPolicy> </policyEntry> </policyEntries></policyMap> </destinationPolicy> <persistenceAdapter> <!-- Here is the default persistence adaptor entry upon installation... commented by abh --> <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${activemq.base}/activemq-data"/> --> <!-- To use a different datasource, use the following syntax : --> <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#oracle-ds"/> </persistenceAdapter> <transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/> <transportConnector name="ssl" uri="ssl://localhost:61617"/> <transportConnector name="stomp" uri="stomp://localhost:61613"/> </transportConnectors> <networkConnectors> <!-- by default just auto discover the other brokers --> <networkConnector name="default-nc" uri="multicast://default"/> <!-- <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/> --> </networkConnectors> </broker> <!-- Oracle DataSource Setup --> <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@databaseserver:1567:dbsid"/> <property name="username" value="*****"/> <property name="password" value="*****"/> <property name="poolPreparedStatements" value="true"/> </bean> </beans> Thanks very much for any assistance. -- View this message in context: http://www.nabble.com/ActiveMQ-takes-a-long%2C-long-time-to-restart-as-NT-service-tf4559640s2354.html#a13012347 Sent from the ActiveMQ - User mailing list archive at Nabble.com.