activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanislaw Kogut <sko...@sistyma.net>
Subject Can't start ActiveMQ 5.4.2 with PostgreSQL 8.4 as persistence backend
Date Mon, 13 Dec 2010 18:46:05 GMT
Hi.


Here is my activemq.xml part for persistence configuration:

        <persistenceAdapter>
                <jdbcPersistenceAdapter
dataDirectory="${activemq.base}/data" dataSource="#pgsql-ds" />
        </persistenceAdapter>
... </broker>

<bean id="pgsql-ds" class="org.postgresql.ds.PGPoolingDataSource">
<property name="serverName" value="localhost"/>
<property name="databaseName" value="activemq"/>
<property name="portNumber" value="5432"/>
<property name="user" value="activemq"/>
<property name="password" value="activemq"/>
<property name="dataSourceName" value="postgres"/>
<property name="initialConnections" value="1"/>
<property name="maxConnections" value="10"/>
</bean>


Then I create database 'activemq', user 'activemq' with password 'activemq'
and granting it access to database in posgress.
But when I'm starting activemq there is an issue with SQL statements:

 INFO | Database adapter driver override recognized for :
[postgresql_native_driver] - adapter: class
org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter
 WARN | Could not create JDBC tables; they could already exist. Failure was:
ALTER TABLE ACTIVEMQ_ACKS DROP PRIMARY KEY Message: ERROR: syntax error at
or near "PRIMARY"
  Position: 32 SQLState: 42601 Vendor code: 0
 WARN | Failure details: ERROR: syntax error at or near "PRIMARY"
  Position: 32
org.postgresql.util.PSQLException: ERROR: syntax error at or near "PRIMARY"
  Position: 32
    at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
    at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:455)
    at $Proxy5.execute(Unknown Source)
    at
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doCreateTables(DefaultJDBCAdapter.java:101)
........

PostgreSQL documentation confirms "DROP PRIMARY KEY" is wrong statement. It
has 'ALTER TABLE ... DROP CONSTRAINT "name"' statement instead.
Looks like after that whole transaction is rolled back, so tables are not
created at all. Is there any success in using PostgreSQL for ActiveMQ?

-- 
Regards,
Stanislaw Kogut
Sistyma LLC

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message