blob: 6fd23f90dae9cea6e66095cfcfb9638186d9fd1c [file] [log] [blame]
<div class="wiki-content maincontent"><p>If you get an error like this</p>
<structured-macro ac:macro-id="9230e83c-a0c1-4e54-a69b-c47ed6c36b23" ac:name="code" ac:schema-version="1"><plain-text-body>
Jun 19, 2006 10:35:27 PM org.apache.activemq.broker.BrokerService getBroker
INFO: ActiveMQ 4.0 JMS Message Broker (localhost) is starting
Jun 19, 2006 10:35:27 PM org.apache.activemq.broker.BrokerService getBroker
INFO: For help or more information please see:
http://incubator.apache.org/activemq/
java.io.IOException: Failed to create database 'derbydb', see the next
exception for details.
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:42)
at
org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:58)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBCPersistenceAdapter.java:229)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:213)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:139)
at
org.apache.activemq.store.journal.JournalPersistenceAdapter.start(JournalPersistenceAdapter.java:215)
at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:930)
at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:888)
at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:458)
at
org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:143)
at
org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:133)
at
com.ic.ntn.message.HelloWorld$HelloWorldBroker.run(HelloWorld.java:92)
at java.lang.Thread.run(Thread.java:595)
Caused by: SQL Exception: Failed to create database 'derbydb', see the next
exception for details.
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.&lt;init&gt;(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.&lt;init&gt;(Unknown
Source)
at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
Source)
at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown
Source)
at
org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:54)
... 11 more
</plain-text-body></structured-macro>
<p>Then the error is probably that the JDBC driver (Apache Derby by default) could not write to the persistent file area.</p>
<h3>Workaround</h3>
<p>Create a directory for the broker to write its files. e.g. in Java code call <a shape="rect" href="http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setDataDirectory(java.io.File)">setDataDirectory</a></p>
<structured-macro ac:macro-id="ec2ce45d-ff66-4b44-86af-55df31e71c78" ac:name="code" ac:schema-version="1"><plain-text-body>
File dir = new File("foo");
dir.mkdir();
broker.setDataDirectory(dir);
</plain-text-body></structured-macro>
<p>or in XML use</p>
<structured-macro ac:macro-id="4720743f-31fc-4604-844a-090611fa027b" ac:name="code" ac:schema-version="1"><plain-text-body>
&lt;broker dataDirectory="foo"&gt;...
</plain-text-body></structured-macro>
<h3>See</h3>
<ul><li><link><page ri:content-title="How do I embed a Broker inside a Connection"></page></link></li></ul>
</div>