You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bbernard <bb...@yahoo.com> on 2006/06/19 16:49:54 UTC

ActiveMQ 4.0 failed to start in embbeded mode

Hi all,

I have just started to play around with ActiveMQ 4.0 on winXP with sun jdk
1.5.0_07, following the instruction on as follow:

        BrokerService broker = new BrokerService();
        // configure the broker
        broker.addConnector("tcp://localhost:61616");
        broker.start();

I have included incubator-activemq-4.0.jar only in my classpath. Adding
derby-10.1.1.0.jar didn't help either. When starteing with the script
provided in bin/ things work just fine.

I must have missed some obvious point, since I got exception (please someone
point out my error?):

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.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(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

Thanks,
/bernard
--
View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4937974
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by James Strachan <ja...@gmail.com>.
Without seeing the entire stack trace I can't be sure whats happening
- I was purely guessing.

On 6/19/06, bbernard <bb...@yahoo.com> wrote:
>
> If derby can create those persistence files, why it failed to start up? While
> using an explisit seting of the data directory work just fine. Sounds like a
> bug?
>
> I am OK with the work around, so long it works! Much appreaciated your super
> quick response, heaps of help for people like me new to the field.
> --
> View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4939638
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by bbernard <bb...@yahoo.com>.
If derby can create those persistence files, why it failed to start up? While
using an explisit seting of the data directory work just fine. Sounds like a
bug?

I am OK with the work around, so long it works! Much appreaciated your super
quick response, heaps of help for people like me new to the field.
--
View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4939638
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by James Strachan <ja...@gmail.com>.
Yes - those are the persistent files used for persistent messaging. If
you don't need persisence you can just turn it off on the broker and
it won't create any files.

On 6/19/06, bbernard <bb...@yahoo.com> wrote:
>
> Thanks James for a super quick response!
>
> Yes, following your suggestion it works OK now.
>
> The thing is I can see dir created by running ActiveMQ, by derbydb in that
>
>         activemq-data/localhost/derbydb/log
>         activemq-data/localhost/derbydb/seg0
>         activemq-data/localhost/derbydb/tmp
>
>         activemq-data/localhost/journal
>
> and there are data in those directories.
> --
> View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4939342
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by bbernard <bb...@yahoo.com>.
Thanks James for a super quick response!

Yes, following your suggestion it works OK now. 

The thing is I can see dir created by running ActiveMQ, by derbydb in that 

        activemq-data/localhost/derbydb/log
        activemq-data/localhost/derbydb/seg0
        activemq-data/localhost/derbydb/tmp

        activemq-data/localhost/journal

and there are data in those directories.
--
View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4939342
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by James Strachan <ja...@gmail.com>.
I added an entry to the FAQ...

http://activemq.org/site/javaioioexception-failed-to-create-database-derbydb-see-the-next-exception-for-details.html

On 6/19/06, James Strachan <ja...@gmail.com> wrote:
> unfortunately the real exception is a stack frame down so I can't
> comment further. I suspect its that the directory can't be created for
> Derby's file system.
>
> A quick hack to fix it is
>
> broker.setPersistent(false);
>
> Another option is to make a directory for the data files and set the location...
>
> File dir = new File("foo");
> dir.mkdir();
> broker.setDataDirectory(dir);
>
> http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setDataDirectory(java.io.File)
>
> On 6/19/06, bbernard <bb...@yahoo.com> wrote:
> >
> > Hi all,
> >
> > I have just started to play around with ActiveMQ 4.0 on winXP with sun jdk
> > 1.5.0_07, following the instruction on as follow:
> >
> >         BrokerService broker = new BrokerService();
> >         // configure the broker
> >         broker.addConnector("tcp://localhost:61616");
> >         broker.start();
> >
> > I have included incubator-activemq-4.0.jar only in my classpath. Adding
> > derby-10.1.1.0.jar didn't help either. When starteing with the script
> > provided in bin/ things work just fine.
> >
> > I must have missed some obvious point, since I got exception (please someone
> > point out my error?):
> >
> > 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.<init>(Unknown Source)
> >         at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(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
> >
> > Thanks,
> > /bernard
> > --
> > View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4937974
> > Sent from the ActiveMQ - User forum at Nabble.com.
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQ 4.0 failed to start in embbeded mode

Posted by James Strachan <ja...@gmail.com>.
unfortunately the real exception is a stack frame down so I can't
comment further. I suspect its that the directory can't be created for
Derby's file system.

A quick hack to fix it is

broker.setPersistent(false);

Another option is to make a directory for the data files and set the location...

File dir = new File("foo");
dir.mkdir();
broker.setDataDirectory(dir);

http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setDataDirectory(java.io.File)

On 6/19/06, bbernard <bb...@yahoo.com> wrote:
>
> Hi all,
>
> I have just started to play around with ActiveMQ 4.0 on winXP with sun jdk
> 1.5.0_07, following the instruction on as follow:
>
>         BrokerService broker = new BrokerService();
>         // configure the broker
>         broker.addConnector("tcp://localhost:61616");
>         broker.start();
>
> I have included incubator-activemq-4.0.jar only in my classpath. Adding
> derby-10.1.1.0.jar didn't help either. When starteing with the script
> provided in bin/ things work just fine.
>
> I must have missed some obvious point, since I got exception (please someone
> point out my error?):
>
> 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.<init>(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(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
>
> Thanks,
> /bernard
> --
> View this message in context: http://www.nabble.com/ActiveMQ-4.0-failed-to-start-in-embbeded-mode-t1811836.html#a4937974
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/