[
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.