Hello active Mq users , I am getting a journal Locked Exception , when ever I re start tomcat. How come the journal is still locked , when the broker is stopped. The following is the exception org.apache.activeio.journal.active.JournalLockedException: Journal is already opened by this application. at org.apache.activeio.journal.active.ControlFile.lock(ControlFile.java:77) at org.apache.activeio.journal.active.LogFileManager.initialize(LogFileMana ger.java:121) at org.apache.activeio.journal.active.LogFileManager.<init>(LogFileManager. java:102) at org.apache.activeio.journal.active.JournalImpl.<init>(JournalImpl.java:1 01) at org.apache.activemq.store.DefaultPersistenceAdapterFactory.createJournal (DefaultPersistenceAdapterFactory.jav a:198) at org.apache.activemq.store.DefaultPersistenceAdapterFactory.getJournal(De faultPersistenceAdapterFactory.java:1 34) at org.apache.activemq.store.DefaultPersistenceAdapterFactory.createPersist enceAdapter(DefaultPersistenceAdapter Factory.java:63) at org.apache.activemq.broker.BrokerService.createPersistenceAdapter(Broker Service.java:968) at org.apache.activemq.broker.BrokerService.getPersistenceAdapter(BrokerSer vice.java:559) at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServic e.java:929) at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java :888) at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:45 8) at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java :143) at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java :133) at com.cisco.cpnm.common.messaging.ActiveMQBrokerServlet.init(ActiveMQBroke rServlet.java:26) The active mq version being used is 4.0.2 . I am starting the broker from tomcat 5.5.20's conf/web.xml . <servlet> <servlet-name>activemqbroker</servlet-name> <servlet-class> com.cisco.cpnm.common.messaging.ActiveMQBrokerServlet </servlet-class> <load-on-startup>6</load-on-startup> </servlet>. the code for the servlet , which starts the broker is public class ActiveMQBrokerServlet extends GenericServlet{
BrokerService broker ; public void init(ServletConfig config) throws ServletException { try{ broker = new BrokerService(); System.out.println("Starting ActiveMQ Broker Service..."); //for the broker URI , do not have leading or trailing spaces File dir = new File("../../activemq"); dir.mkdir(); broker.setDataDirectory(dir); broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxInac tivityDuration=-1"); broker.start(); System.out.println("Active MQ Broker Started at local host port 61616"); }catch(Exception e){ e.printStackTrace(); } } public void destroy(){ try{ broker.stop(); System.out.println("Active MQ Broker Stopped at localhost port 61616"); }catch(Exception e){ System.err.println(e.getMessage()); e.printStackTrace(); throw new RuntimeException(e); } } } The jars needed by active are placed in Tomcat's shared/lib folder. Please let me know, as to how to overcome this issue. thanks, Suchitha.