You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "HiSkill (JIRA)" <ji...@apache.org> on 2009/11/16 19:15:52 UTC

[jira] Created: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
---------------------------------------------------------

                 Key: AMQ-2496
                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.3.0
         Environment: MS SQL 2008
            Reporter: HiSkill
            Priority: Blocker


Env:
- ActiveMQ 5.3.0
- deployed as RAR on JBoss
- database : MS SQL 2008

When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.

Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.

Here is my broker-config.xml :

<beans xmlns="http://activemq.apache.org/schema/core">

  <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
    
  <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
       <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
       <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
       <property name="username" value="sql"/>
       <property name="password" value="sql"/>
       <property name="initialSize" value="10"/>
       <property name="poolPreparedStatements" value="true"/>
  </bean>
  
  <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
  <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">

     <destinations>
	    <topic physicalName="pocket" />
     </destinations>
    
     <managementContext>
       <!-- use appserver provided context instead of creating one,
            for jboss use: -Djboss.platform.mbeanserver -->
       <managementContext createConnector="false"/>
     </managementContext>

    <persistenceAdapter>
      	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
        <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
        <!-- To use a different datasource, use th following syntax : -->
            
        <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
      
     	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
     	
    </persistenceAdapter>
    
    <transportConnectors>
      	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
    </transportConnectors>
    
  </broker>
</beans>


Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "HiSkill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59330#action_59330 ] 

HiSkill commented on AMQ-2496:
------------------------------

After making the above change, it does create all the tables for MSSQL2008, basically this issue was seen for all sql versions where sqljdbc4.jar is used.

Now the issue is resolved for MSSQL, with the config change we are having a regression and none of the tables are getting created for ORACLE with the config change.

2010-05-13 14:25:02,826 INFO [STDOUT] 2010-05-13 14:25:02,826 [ActiveMQ Broker] WARN DefaultJDBCAdapter - Could not create JDBC tables; they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG IMAGE, PRIMARY KEY ( ID ) ) Message: ORA-00902: invalid datatype 
 SQLState: 42000 Vendor code: 902 

BIGINT is not a valid colum type in oracle.

We will have to revert the above config change and live with workaround of manually creating tables for MSSQL2008.

Is theren't a solution yet on this?

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "Bruce Snyder (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Snyder updated AMQ-2496:
------------------------------

    Fix Version/s: 5.5.0
                       (was: 5.4.1)

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: hiskill
>            Priority: Blocker
>             Fix For: 5.5.0
>
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59349#action_59349 ] 

Gary Tully commented on AMQ-2496:
---------------------------------

in the short term can you treat these as two different configurations? The issue is differences in SLQ dialect, no?

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: hiskill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "hiskill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59348#action_59348 ] 

hiskill commented on AMQ-2496:
------------------------------

Can someone advice on this issue?  Adviced config change in broker-config.xml only solves the problem for MSSQL, it created a regression in ORACLE now.

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: hiskill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "hiskill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59353#action_59353 ] 

hiskill commented on AMQ-2496:
------------------------------

Its not just between ORACLE and MSSQL, we need to support any database for our application.  We can't have different configurations based on databases.

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: hiskill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "HiSkill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55564#action_55564 ] 

HiSkill commented on AMQ-2496:
------------------------------

Here is the log when create ACTIVEMQ_MSGS failed, it would be great to know what the problem is for MS SQL 2008.

2009-11-18 09:08:32,080 INFO  [STDOUT] 2009-11-18 09:08:32,080 [ActiveMQ Broker] WARN  DefaultJDBCAdapter             - Could not create JDBC tables; they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG BLOB, PRIMARY KEY ( ID ) ) Message: Column, parameter, or variable #6: Cannot find data type BLOB. SQLState: S0007 Vendor code: 2715
2009-11-18 09:08:32,314 INFO  [STDOUT] 2009-11-18 09:08:32,314 [ActiveMQ Broker] WARN  DefaultJDBCAdapter             - Could not create JDBC tables; they could already exist. Failure was: CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ) Message: Cannot find the object "ACTIVEMQ_MSGS" because it does not exist or you do not have permissions. SQLState: S00012 Vendor code: 1088
2009-11-18 09:08:32,580 INFO  [STDOUT] 2009-11-18 09:08:32,580 [ActiveMQ Broker] WARN  DefaultJDBCAdapter             - Could not create JDBC tables; they could already exist. Failure was: CREATE INDEX ACTIVEMQ_MSGS_CIDX ON ACTIVEMQ_MSGS (CONTAINER) Message: Cannot find the object "ACTIVEMQ_MSGS" because it does not exist or you do not have permissions. SQLState: S00012 Vendor code: 1088
2009-11-18 09:08:32,830 INFO  [STDOUT] 2009-11-18 09:08:32,830 [ActiveMQ Broker] WARN  DefaultJDBCAdapter             - Could not create JDBC tables; they could already exist. Failure was: CREATE INDEX ACTIVEMQ_MSGS_EIDX ON ACTIVEMQ_MSGS (EXPIRATION) Message: Cannot find the object "ACTIVEMQ_MSGS" because it does not exist or you do not have permissions. SQLState: S00012 Vendor code: 1088


> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "Adam Creeger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56444#action_56444 ] 

Adam Creeger commented on AMQ-2496:
-----------------------------------

Actually, it looks like the bug is that the correct JDBC Adapter isn't being used. You can fix this by specifying it manually in activemq.xml.

A simple example:

{code:XML|title=Excerpt from activemq.xml}
<persistenceAdapter>
    <jdbcPersistenceAdapter  dataSource="#mssql-ds">
        <adapter><transact-jdbc-adapter/></adapter>
    </jdbcPersistenceAdapter>
</persistenceAdapter>
{code}

Once you do this, it will use the Image type.



> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "HiSkill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55566#action_55566 ] 

HiSkill commented on AMQ-2496:
------------------------------

Issue is that for column ACTIVEMQ_MSGS.MSG  type given as BLOB instead of IMAGE.

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59154#action_59154 ] 

Gary Tully commented on AMQ-2496:
---------------------------------

should do, those attributes are exposed and they delegate to the underlying persistence adapter.

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "hiskill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59392#action_59392 ] 

hiskill commented on AMQ-2496:
------------------------------

Same issue is seen with DB2 as well.

> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: hiskill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "HiSkill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59153#action_59153 ] 

HiSkill commented on AMQ-2496:
------------------------------

But your configuration is not for journaledJDBC.

Will this work for journaledJDBC?

<persistenceAdapter>
<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
<adapter><transact-jdbc-adapter/></adapter>
</journaledJDBC 
</persistenceAdapter>





> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2496) journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55586#action_55586 ] 

Gary Tully commented on AMQ-2496:
---------------------------------

Looks like image should be the preferred data type (for BLOB)  for all SQLServer instances post 2000

Note: "Binary Data" section of http://technet.microsoft.com/en-us/library/bb497065.aspx
and
http://technet.microsoft.com/en-us/library/cc917636.aspx


> journaledJDBC not creating ACTIVEMQ_MSGS with MS SQL 2008
> ---------------------------------------------------------
>
>                 Key: AMQ-2496
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2496
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: MS SQL 2008
>            Reporter: HiSkill
>            Priority: Blocker
>
> Env:
> - ActiveMQ 5.3.0
> - deployed as RAR on JBoss
> - database : MS SQL 2008
> When the broker starts up for the first time, table ACTIVEMQ_MSGS  is not getting created automatically which throws the below exception and the broker never comes up.
> Reason: java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> java.io.IOException: Failed to get last broker message id: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ACTIVEMQ_MSGS'.
> at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
> at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:170)
> at org.apache.activemq.store.journal.JournalPersistenceAdapter.getLastMessageBrokerSequenceId(JournalPersistenceAdapter.java:212)
> at org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:140)
> at org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:106)
> at org.apache.activemq.broker.jmx.ManagedRegionBroker.<init>(ManagedRegionBroker.java:94)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1695)
> at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1689)
> at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1649)
> at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:667)
> at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:1866)
> at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1853)
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:450)
> at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> Only workaround is to create the table ACTIVEMQ_MSGS manually and restart the broker.
> Here is my broker-config.xml :
> <beans xmlns="http://activemq.apache.org/schema/core">
>   <bean xmlns="" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>     
>   <bean xmlns="" id="my-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>        <property name="url" value="jdbc:sqlserver://mydb:1433;databaseName=myds"/>
>        <property name="username" value="sql"/>
>        <property name="password" value="sql"/>
>        <property name="initialSize" value="10"/>
>        <property name="poolPreparedStatements" value="true"/>
>   </bean>
>   
>   <!--  shutdown hook is disabled as RAR classloader may be gone at shutdown -->
>   <broker useJmx="true" brokerName="sample.broker1" useShutdownHook="false">
>      <destinations>
> 	    <topic physicalName="pocket" />
>      </destinations>
>     
>      <managementContext>
>        <!-- use appserver provided context instead of creating one,
>             for jboss use: -Djboss.platform.mbeanserver -->
>        <managementContext createConnector="false"/>
>      </managementContext>
>     <persistenceAdapter>
>       	<!-- <amqPersistenceAdapter syncOnWrite="false" directory="${jboss.server.data.dir}/activemq" maxFileLength="20 mb"/>  -->
>         <!-- <journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq"/> -->
>         <!-- To use a different datasource, use th following syntax : -->
>             
>         <!-- <kahaPersistenceAdapter directory="${jboss.server.data.dir}/activemq" maxDataFileLength="33554432"/> -->
>       
>      	<journaledJDBC journalLogFiles="5" dataDirectory="${jboss.server.data.dir}/activemq" dataSource="#my-ds" useDatabaseLock="false" />
>      	
>     </persistenceAdapter>
>     
>     <transportConnectors>
>       	<transportConnector name="sample.broker1" uri="tcp://localhost:3030" discoveryUri="multicast://default"/>
>     </transportConnectors>
>     
>   </broker>
> </beans>
> Note that I don't see the issue with MSSQL 2000 2005, not sure whats the problem with 2008 version.
> Let me know if there is any cofiguration missing which would resolve the issue with MS SQL 2008 and any other databases which could have the sample problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.