blob: 7b4637c9782fae08adc632de53a29f41c8fc77aa [file] [log] [blame]
<div class="wiki-content maincontent"><h3>Error</h3>
<p>You get something like this</p>
<structured-macro ac:macro-id="775cffc6-08c3-4a76-9070-7f6a96b8d64e" ac:name="code" ac:schema-version="1"><plain-text-body>
java.io.IOException: Journal is already opened by this application.
at
org.apache.activeio.journal.active.ControlFile.lock(ControlFile.java:71)
at
org.apache.activeio.journal.active.LogFileManager.initialize(LogFileManager.java:120)
at
org.apache.activeio.journal.active.LogFileManager.&lt;init&gt;(LogFileManager.java:101)
at
org.apache.activeio.journal.active.JournalImpl.&lt;init&gt;(JournalImpl.java:99)
at
org.apache.activemq.store.DefaultPersistenceAdapterFactory.createJournal(DefaultPersistenceAdapterFactory.java:198)
at
org.apache.activemq.store.DefaultPersistenceAdapterFactory.getJournal(DefaultPersistenceAdapterFactory.java:134)
</plain-text-body></structured-macro>
<h3>Description</h3>
<p>Each broker needs to have its own directory to store its journal files etc. The error indicates that you have 2 brokers sharing the same files.</p>
<p>A common cause of this exception is that you are running two brokers on one machine using the same config file pointing to the same directory. So a work around is to parameterise the directory name via Spring's property syntax - or just create another configuration file so that the second broker uses a different directory.</p>
<p>Another cause of this problem is if you are using the vm://localhost style transport in a JMS client with the JMS connection starting before you have initialised your broker. If you create a vm transport connection, it will auto-create a broker if there is not one running already; so you can end up creating 2 brokers by accident. The work around is to make sure that the JMS connection factory you are using depends on the broker you are configuring (e.g. in Spring use a <strong>depends-on</strong> attribute on the connection factory to make it depend on the broker). This will ensure that the broker is initialized first before the connection factory.</p>
<structured-macro ac:macro-id="04388450-4760-44b0-9ebe-9c4de4a6b01f" ac:name="warning" ac:schema-version="1"><parameter ac:name="title">Be careful with broker names and URIs</parameter><rich-text-body>
<p>Make sure you do not use any strange characters in the names of brokers as they are converted to URIs which <a shape="rect" href="http://java.sun.com/j2se/1.4.2/docs/api/java/net/URI.html">do not allow things like underscores</a> in them etc.</p></rich-text-body></structured-macro>
<p>This problem could also be caused by <link><page ri:content-title="The Broker will not start"></page><link-body>a bad OS and JVM combination</link-body></link></p></div>