activemq and sql server 2008

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

activemq and sql server 2008

yair-2
Hi all
I'm trying to configure a master/slave conf with JDBC. I can't get the JDBC to work with sql server 2008:

18:02:45,875 [main] WARN  JDBCPersistenceAdapter - Database driver NOT recognized: [microsoft_sql_server_jdbc_driver_2_0].  Will use default JDBC implementation.
18:02:46,125 [main] WARN  DefaultJDBCAdapter - Could not create JDBC tables; they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID INTEGER NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ INTEGER, EXPIRATION BIGINT, MSG BLOB, PRIMARY KEY ( ID ) ) Message: Column, parameter, or variable #6: Cannot find data type BLOB. SQLState: S0007 Vendor code: 2715
18:02:46,203 [main] 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
18:02:46,203 [main] 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
18:02:46,203 [main] 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
18:02:46,265 [main] ERROR DefaultDatabaseLocker - Failed to acquire lock: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

I read around that this (the last line at least) is a known issue with sql server 2005. Is there a fix for sql server 2008?

Thanks,
Yair
Reply | Threaded
Open this post in threaded view
|

Re: activemq and sql server 2008

gtully
The problem is a missing resource file, from trunk the file that needs to be
in activemq-core.jar
is /activemq-core/src/main/resources/META-INF/services/org/apache/activemq/store/jdbc/microsoft_sql_server_jdbc_2_0_driver

This file corresponds to the database driver name and contains an
indirection to use the
org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter rather than the
default implementation. This was added from a contributed fix for
https://issues.apache.org/activemq/browse/AMQ-2492 and will be in 5.3.1

As a work around you can create an instance
of org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter and set it as
the adapter in your configured JDBCPersistenceAdapter adapter via the xml
configuration.


2010/1/20 yair <[hidden email]>

>
> Hi all
> I'm trying to configure a master/slave conf with JDBC. I can't get the JDBC
> to work with sql server 2008:
>
> 18:02:45,875 [main] WARN  JDBCPersistenceAdapter - Database driver NOT
> recognized: [microsoft_sql_server_jdbc_driver_2_0].  Will use default JDBC
> implementation.
> 18:02:46,125 [main] WARN  DefaultJDBCAdapter - Could not create JDBC
> tables;
> they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID
> INTEGER
> NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ
> INTEGER, EXPIRATION BIGINT, MSG BLOB, PRIMARY KEY ( ID ) ) Message: Column,
> parameter, or variable #6: Cannot find data type BLOB. SQLState: S0007
> Vendor code: 2715
> 18:02:46,203 [main] 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
> 18:02:46,203 [main] 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
> 18:02:46,203 [main] 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
> 18:02:46,265 [main] ERROR DefaultDatabaseLocker - Failed to acquire lock:
> com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause
> allowed only for DECLARE CURSOR.
>
> I read around that this (the last line at least) is a known issue with sql
> server 2005. Is there a fix for sql server 2008?
>
> Thanks,
> Yair
> --
> View this message in context:
> http://old.nabble.com/activemq-and-sql-server-2008-tp27237830p27237830.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


--
http://blog.garytully.com

Open Source Integration
http://fusesource.com
Reply | Threaded
Open this post in threaded view
|

Re: activemq and sql server 2008

magellings
In reply to this post by yair-2
We are using ActiveMQ 5.2 with MSSQL 2008 just fine.

we drop sqljdbc.jar in apache-activemq-5.2.0\lib\optional with Date Modified timestamp of 10/11/2007 11:10AM (and we also use the c3po connection pooler)

add the following config in activemq.xml


    <persistenceAdapter>
      <jdbcPersistenceAdapter dataSource="#mssql-ds" createTablesOnStartup="false"   />
    </persistenceAdapter>


  <bean id="mssql-ds" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
    <property name="jdbcUrl" value="jdbc:sqlserver://Server.qg.com:1433;databaseName=DatabaseName"/>
    <property name="user" value="sdfsdf"/>
    <property name="password" value="sdfsdf"/>
    <property name="acquireRetryAttempts" value="100"/>
    <property name="testConnectionOnCheckout" value="true"/>
    <property name="testConnectionOnCheckin" value="true"/>
    <property name="automaticTestTable" value="ACTIVEMQ_CONN_TEST"/>
    <property name="acquireRetryDelay" value="5000"/>
    <property name="preferredTestQuery" value="SELECT 1"/>
  </bean>



yair wrote
Hi all
I'm trying to configure a master/slave conf with JDBC. I can't get the JDBC to work with sql server 2008:

18:02:45,875 [main] WARN  JDBCPersistenceAdapter - Database driver NOT recognized: [microsoft_sql_server_jdbc_driver_2_0].  Will use default JDBC implementation.
18:02:46,125 [main] WARN  DefaultJDBCAdapter - Could not create JDBC tables; they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID INTEGER NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ INTEGER, EXPIRATION BIGINT, MSG BLOB, PRIMARY KEY ( ID ) ) Message: Column, parameter, or variable #6: Cannot find data type BLOB. SQLState: S0007 Vendor code: 2715
18:02:46,203 [main] 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
18:02:46,203 [main] 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
18:02:46,203 [main] 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
18:02:46,265 [main] ERROR DefaultDatabaseLocker - Failed to acquire lock: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

I read around that this (the last line at least) is a known issue with sql server 2005. Is there a fix for sql server 2008?

Thanks,
Yair