You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Suchitha Koneru (sukoneru)" <su...@cisco.com> on 2007/02/28 02:24:27 UTC

derby db does not start , when context is reloaded

Hello Active MQ users , 
                   I have an embedded broker described by the following
java class. It is started as a servletContextlistener , in tomcat 5.5

public class ActiveMQBrokerStartListener implements
ServletContextListener {

BrokerService broker = new BrokerService();

public void contextInitialized(ServletContextEvent arg0) {

try{

System.out.println("Starting ActiveMQ Broker Service...");

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){

System.err.println(e.getMessage());

e.printStackTrace();

throw new RuntimeException(e);

}

}

public void contextDestroyed(ServletContextEvent arg0) {

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);

}

}

}

In the web.xml , I have an entry for the above  listener as follows 

<listener>
        <listener-class>
         com.cisco.cpnm.common.messaging.ActiveMQBrokerStartListener
        </listener-class>
     </listener>

When ever the  context is reloaded 

I get the following exception 

Failed to start database 'derbydb', see the next exception for details.
java.io.IOException: Failed to start database 'derbydb', see the next
exception for details.
        at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.ja
va:42)
        at
org.apache.activemq.store.jdbc.TransactionContext.getConnection(Transact
ionContext.java:58)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBC
PersistenceAdapter.java:229)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPer
sistenceAdapter.java:213)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersiste
nceAdapter.java:139)
        at
org.apache.activemq.store.journal.JournalPersistenceAdapter.start(Journa
lPersistenceAdapter.java:216)
        at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServic
e.java:930)
        at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java
:888)
       ......

Please let me know, if there is a work around.

I have the following active mq jars 

 activemq-core-4.0.1.jar  ,backport-util-concurrent-2.1.jar ,
geronimo-j2ee-management_1.0_spec-1.0.jar

geronimo-jms_1.1_spec-1.0.jar  , incubator-activemq-4.0.2.jar.

thanks,.

Suchitha.

 


Re: derby db does not start , when context is reloaded

Posted by James Strachan <ja...@gmail.com>.
See the example commented out configurations in activemq.xml

On 2/28/07, Suchitha Koneru (sukoneru) <su...@cisco.com> wrote:
> Thanks for the suggestion. Is there any documentation , which I can
> refer to , in regard to configuring data base for active mq.
> Sucgitha
>
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: Tuesday, February 27, 2007 10:45 PM
> To: users@activemq.apache.org
> Subject: Re: derby db does not start , when context is reloaded
>
> I guess a good work around is to switch to a different database; such as
> using MySQL or Postgresql
>
>
> On 2/28/07, Suchitha Koneru (sukoneru) <su...@cisco.com> wrote:
> > Hello Active MQ users ,
> >                    I have an embedded broker described by the
> > following java class. It is started as a servletContextlistener , in
> > tomcat 5.5
> >
> > public class ActiveMQBrokerStartListener implements
> > ServletContextListener {
> >
> > BrokerService broker = new BrokerService();
> >
> > public void contextInitialized(ServletContextEvent arg0) {
> >
> > try{
> >
> > System.out.println("Starting ActiveMQ Broker Service...");
> >
> > File dir = new File("../../activemq");
> >
> > dir.mkdir();
> >
> > broker.setDataDirectory(dir);
> >
> > broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxIn
> > ac
> > tivityDuration=-1");
> >
> > broker.start();
> >
> > System.out.println("Active MQ Broker Started at local host port
> > 61616");
> >
> > }catch(Exception e){
> >
> > System.err.println(e.getMessage());
> >
> > e.printStackTrace();
> >
> > throw new RuntimeException(e);
> >
> > }
> >
> > }
> >
> > public void contextDestroyed(ServletContextEvent arg0) {
> >
> > 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);
> >
> > }
> >
> > }
> >
> > }
> >
> > In the web.xml , I have an entry for the above  listener as follows
> >
> > <listener>
> >         <listener-class>
> >          com.cisco.cpnm.common.messaging.ActiveMQBrokerStartListener
> >         </listener-class>
> >      </listener>
> >
> > When ever the  context is reloaded
> >
> > I get the following exception
> >
> > Failed to start database 'derbydb', see the next exception for
> details.
> > java.io.IOException: Failed to start database 'derbydb', see the next
> > exception for details.
> >         at
> > org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.
> > ja
> > va:42)
> >         at
> > org.apache.activemq.store.jdbc.TransactionContext.getConnection(Transa
> > ct
> > ionContext.java:58)
> >         at
> > org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JD
> > BC
> > PersistenceAdapter.java:229)
> >         at
> > org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCP
> > er
> > sistenceAdapter.java:213)
> >         at
> > org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersis
> > te
> > nceAdapter.java:139)
> >         at
> > org.apache.activemq.store.journal.JournalPersistenceAdapter.start(Jour
> > na
> > lPersistenceAdapter.java:216)
> >         at
> > org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServ
> > ic
> > e.java:930)
> >         at
> > org.apache.activemq.broker.BrokerService.createBroker(BrokerService.ja
> > va
> > :888)
> >        ......
> >
> > Please let me know, if there is a work around.
> >
> > I have the following active mq jars
> >
> >  activemq-core-4.0.1.jar  ,backport-util-concurrent-2.1.jar ,
> > geronimo-j2ee-management_1.0_spec-1.0.jar
> >
> > geronimo-jms_1.1_spec-1.0.jar  , incubator-activemq-4.0.2.jar.
> >
> > thanks,.
> >
> > Suchitha.
> >
> >
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

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

RE: derby db does not start , when context is reloaded

Posted by "Suchitha Koneru (sukoneru)" <su...@cisco.com>.
Thanks for the suggestion. Is there any documentation , which I can
refer to , in regard to configuring data base for active mq. 
Sucgitha 

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Tuesday, February 27, 2007 10:45 PM
To: users@activemq.apache.org
Subject: Re: derby db does not start , when context is reloaded

I guess a good work around is to switch to a different database; such as
using MySQL or Postgresql


On 2/28/07, Suchitha Koneru (sukoneru) <su...@cisco.com> wrote:
> Hello Active MQ users ,
>                    I have an embedded broker described by the 
> following java class. It is started as a servletContextlistener , in 
> tomcat 5.5
>
> public class ActiveMQBrokerStartListener implements 
> ServletContextListener {
>
> BrokerService broker = new BrokerService();
>
> public void contextInitialized(ServletContextEvent arg0) {
>
> try{
>
> System.out.println("Starting ActiveMQ Broker Service...");
>
> File dir = new File("../../activemq");
>
> dir.mkdir();
>
> broker.setDataDirectory(dir);
>
> broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxIn
> ac
> tivityDuration=-1");
>
> broker.start();
>
> System.out.println("Active MQ Broker Started at local host port 
> 61616");
>
> }catch(Exception e){
>
> System.err.println(e.getMessage());
>
> e.printStackTrace();
>
> throw new RuntimeException(e);
>
> }
>
> }
>
> public void contextDestroyed(ServletContextEvent arg0) {
>
> 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);
>
> }
>
> }
>
> }
>
> In the web.xml , I have an entry for the above  listener as follows
>
> <listener>
>         <listener-class>
>          com.cisco.cpnm.common.messaging.ActiveMQBrokerStartListener
>         </listener-class>
>      </listener>
>
> When ever the  context is reloaded
>
> I get the following exception
>
> Failed to start database 'derbydb', see the next exception for
details.
> java.io.IOException: Failed to start database 'derbydb', see the next 
> exception for details.
>         at
> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.
> ja
> va:42)
>         at
> org.apache.activemq.store.jdbc.TransactionContext.getConnection(Transa
> ct
> ionContext.java:58)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JD
> BC
> PersistenceAdapter.java:229)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCP
> er
> sistenceAdapter.java:213)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersis
> te
> nceAdapter.java:139)
>         at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.start(Jour
> na
> lPersistenceAdapter.java:216)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServ
> ic
> e.java:930)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.ja
> va
> :888)
>        ......
>
> Please let me know, if there is a work around.
>
> I have the following active mq jars
>
>  activemq-core-4.0.1.jar  ,backport-util-concurrent-2.1.jar , 
> geronimo-j2ee-management_1.0_spec-1.0.jar
>
> geronimo-jms_1.1_spec-1.0.jar  , incubator-activemq-4.0.2.jar.
>
> thanks,.
>
> Suchitha.
>
>
>
>


-- 

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

Re: derby db does not start , when context is reloaded

Posted by James Strachan <ja...@gmail.com>.
I guess a good work around is to switch to a different database; such
as using MySQL or Postgresql


On 2/28/07, Suchitha Koneru (sukoneru) <su...@cisco.com> wrote:
> Hello Active MQ users ,
>                    I have an embedded broker described by the following
> java class. It is started as a servletContextlistener , in tomcat 5.5
>
> public class ActiveMQBrokerStartListener implements
> ServletContextListener {
>
> BrokerService broker = new BrokerService();
>
> public void contextInitialized(ServletContextEvent arg0) {
>
> try{
>
> System.out.println("Starting ActiveMQ Broker Service...");
>
> 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){
>
> System.err.println(e.getMessage());
>
> e.printStackTrace();
>
> throw new RuntimeException(e);
>
> }
>
> }
>
> public void contextDestroyed(ServletContextEvent arg0) {
>
> 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);
>
> }
>
> }
>
> }
>
> In the web.xml , I have an entry for the above  listener as follows
>
> <listener>
>         <listener-class>
>          com.cisco.cpnm.common.messaging.ActiveMQBrokerStartListener
>         </listener-class>
>      </listener>
>
> When ever the  context is reloaded
>
> I get the following exception
>
> Failed to start database 'derbydb', see the next exception for details.
> java.io.IOException: Failed to start database 'derbydb', see the next
> exception for details.
>         at
> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.ja
> va:42)
>         at
> org.apache.activemq.store.jdbc.TransactionContext.getConnection(Transact
> ionContext.java:58)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBC
> PersistenceAdapter.java:229)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPer
> sistenceAdapter.java:213)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersiste
> nceAdapter.java:139)
>         at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.start(Journa
> lPersistenceAdapter.java:216)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerServic
> e.java:930)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java
> :888)
>        ......
>
> Please let me know, if there is a work around.
>
> I have the following active mq jars
>
>  activemq-core-4.0.1.jar  ,backport-util-concurrent-2.1.jar ,
> geronimo-j2ee-management_1.0_spec-1.0.jar
>
> geronimo-jms_1.1_spec-1.0.jar  , incubator-activemq-4.0.2.jar.
>
> thanks,.
>
> Suchitha.
>
>
>
>


-- 

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