Quantcast

problems about database when starting a in-vm broker

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problems about database when starting a in-vm broker

hyqgod
i am planning to use spring to start a in-vm activemq broker in tomcat. But when i start the tomcat, i get the error messages below in the log file which means that i don't create a table for activemq,
    nested exception is java.io.IOException: Failed to get last broker message id: java.sql.SQLException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in ServletContext resource [/WEB-INF/activemq.xml]: Invocation of init method failed; nested exception is java.io.IOException: Failed to get last broker message id: java.sql.SQLException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
Caused by: java.io.IOException: Failed to get last broker message id: java.sql.SQLException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
        at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:146)
        at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:185)
        at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:148)
        at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:109)
        at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:100)
        at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1385)
        at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1319)
        at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:521)
        at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1558)
        at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1544)
        at org.apache.activemq.broker.BrokerService.start(BrokerService.java:411)
        at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)

i try to find the answer,but get nothing,so could anyone can help me?

by the way: my activemq broker configuration file's content is :

  <?xml version="1.0" encoding="utf-8"?>
<beans>
         <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
         <broker persistent="true" brokerName="localhost" dataDirectory="data"  xmlns="http://activemq.org/config/1.0" start="true">
    <destinations>
      <queue physicalName="JSI.QUEUE.TEST" />
      <topic physicalName="JSI.TOPIC.TEST" />
    </destinations>
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
       <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
       <transportConnector name="xmpp"    uri="xmpp://localhost:61222"/>
    </transportConnectors>

   
    <networkConnectors>
     
      <networkConnector name="default-nc" uri="multicast://default"/>
    </networkConnectors>


   
    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5" dataDirectory="activemq-data"  dataSource="#mysql-ds"/>
    </persistenceAdapter>
   
 </broker>
   
 
  <commandAgent  xmlns="http://activemq.org/config/1.0"/>

 
   <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://10.10.3.137/activemq?relaxAutoCommit=true"/>
    <property name="username" value="activemq"/>
    <property name="password" value="activemq"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>
</beans>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems about database when starting a in-vm broker

James Strachan-2
Could you show the entire logs, with debug enabled maybe. I suspect
the mysql database does not have SQL permissions to create the
ActiveMQ SQL schema (which it tries to create by default on startup)


On 4/10/07, hyqgod <[hidden email]> wrote:

>
> i am planning to use spring to start a in-vm activemq broker in tomcat. But
> when i start the tomcat, i get the error messages below in the log file
> which means that i don't create a table for activemq,
>     nested exception is java.io.IOException: Failed to get last broker
> message id: java.sql.SQLException: Table 'activemq.ACTIVEMQ_ACKS' doesn't
> exist org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService'
> defined in ServletContext resource [/WEB-INF/activemq.xml]: Invocation of
> init method failed; nested exception is java.io.IOException: Failed to get
> last broker message id: java.sql.SQLException: Table
> 'activemq.ACTIVEMQ_ACKS' doesn't exist
> Caused by: java.io.IOException: Failed to get last broker message id:
> java.sql.SQLException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
>         at
> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
>         at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:146)
>         at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:185)
>         at
> org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:148)
>         at
> org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:109)
>         at
> org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:100)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1385)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1319)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:521)
>         at
> org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1558)
>         at
> org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1544)
>         at org.apache.activemq.broker.BrokerService.start(BrokerService.java:411)
>         at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
>
> i try to find the answer,but get nothing,so could anyone can help me?
>
> by the way: my activemq broker configuration file's content is :
>
>   <?xml version="1.0" encoding="utf-8"?>
> <beans>
>          <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>          <broker persistent="true" brokerName="localhost" dataDirectory="data"
> xmlns="http://activemq.org/config/1.0" start="true">
>         <destinations>
>                 <queue physicalName="JSI.QUEUE.TEST" />
>                 <topic physicalName="JSI.TOPIC.TEST" />
>         </destinations>
>         <transportConnectors>
>        <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>        <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
>        <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
>        <transportConnector name="xmpp"    uri="xmpp://localhost:61222"/>
>     </transportConnectors>
>
>     <!-- The store and forward broker networks ActiveMQ will listen to -->
>     <networkConnectors>
>       <!-- by default just auto discover the other brokers -->
>       <networkConnector name="default-nc" uri="multicast://default"/>
>     </networkConnectors>
>
>
>     <!-- Use the following if you wish to configure the journal with JDBC
> -->
>     <persistenceAdapter>
>         <journaledJDBC journalLogFiles="5" dataDirectory="activemq-data"
> dataSource="#mysql-ds"/>
>     </persistenceAdapter>
>
>  </broker>
>
>  <!-- lets create a command agent to respond to message based admin commands
> on the ActiveMQ.Agent topic -->
>   <commandAgent  xmlns="http://activemq.org/config/1.0"/>
>
>   <!-- MySql DataSource Sample Setup -->
>    <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>     <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
>     <property name="url"
> value="jdbc:mysql://10.10.3.137/activemq?relaxAutoCommit=true"/>
>     <property name="username" value="activemq"/>
>     <property name="password" value="activemq"/>
>     <property name="poolPreparedStatements" value="true"/>
>   </bean>
> </beans>
>
> --
> View this message in context: http://www.nabble.com/problems-about-database-when-starting-a--in-vm-broker-tf3553097s2354.html#a9920108
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems about database when starting a in-vm broker

hyqgod
i get the log infomation from my tomcat logs ,i don't know whether it is you want .. that is the entire log info below:

2007-04-11 10:13:03 StandardContext[/ActiveMQ-Web]Failed to create broker: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in ServletContext resource [/WEB-INF/activemq.xml]: Invocation of init method failed; nested exception is java.io.IOException: Failed to get last broker message id: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in ServletContext resource [/WEB-INF/activemq.xml]: Invocation of init method failed; nested exception is java.io.IOException: Failed to get last broker message id: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
Caused by: java.io.IOException: Failed to get last broker message id: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
        at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:146)
        at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:185)
        at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:148)
        at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:109)
        at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:100)
        at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1385)
        at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1319)
        at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:521)
        at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1558)
        at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1544)
        at org.apache.activemq.broker.BrokerService.start(BrokerService.java:411)
        at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
        at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:88)
        at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:76)
        at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:72)
        at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:68)
        at org.apache.activemq.xbean.BrokerFactoryBean.afterPropertiesSet(BrokerFactoryBean.java:84)
        at org.apache.activemq.web.SpringBrokerContextListener.createBroker(SpringBrokerContextListener.java:110)
        at org.apache.activemq.web.SpringBrokerContextListener.contextInitialized(SpringBrokerContextListener.java:72)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
        at org.apache.catalina.core.StandardService.start(StandardService.java:480)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'activemq.ACTIVEMQ_ACKS' doesn't exist
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1403)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
        at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doGetLastMessageBrokerSequenceId(DefaultJDBCAdapter.java:148)
        at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:143)
        ... 52 more

2007-04-11 10:13:03 StandardContext[/ActiveMQ-Web]Starting ActiveMQ Broker
2007-04-11 10:13:03 StandardContext[/ActiveMQ-Web]Failed to start ActiveMQ broker: java.lang.NullPointerException
java.lang.NullPointerException
        at org.apache.activemq.web.SpringBrokerContextListener.contextInitialized(SpringBrokerContextListener.java:76)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
        at org.apache.catalina.core.StandardService.start(StandardService.java:480)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

James.Strachan wrote
Could you show the entire logs, with debug enabled maybe. I suspect
the mysql database does not have SQL permissions to create the
ActiveMQ SQL schema (which it tries to create by default on startup)
> View this message in context: http://www.nabble.com/problems-about-database-when-starting-a--in-vm-broker-tf3553097s2354.html#a9920108
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


--

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