Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6780

New Postgres JDBC-Driver not recognized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.15.0
    • 5.15.7, 5.16.0
    • JDBC

    Description

      After our switch of the postgres-jdbc-driver from version 9.4-1201 to 42.1.3 the JDBCPersistenceAdapter does not recognize postgres any more.
      The log:

      new driver
      2017-07-31 19:35:52,733 [INFO ] 259-949-060 [JDBCPersistenceAdapter : loadAdapter] - Database adapter driver override not found for : [postgresql_jdbc_driver].  Will use default implementation.
      2017-07-31 19:35:52,765 [WARN ] 259-949-060 [DefaultJDBCAdapter : executeStatement] - Could not create JDBC tables; they could already exist. Failure was: CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250) NOT NULL, MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG BLOB, PRIMARY KEY ( ID ) ) Message: ERROR: type "blob" does not exist
        Position: 147 SQLState: 42704 Vendor code: 0
      
      old driver
      2017-07-31 19:37:21,021 [INFO ] 11b-e48-c83 [JDBCPersistenceAdapter : loadAdapter] - Database adapter driver override recognized for : [postgresql_native_driver] - adapter: class org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter
      

      The cause is the change of the name from "postgres_native_driver" to "postgres_jdbc_driver" (getDriverName() now returns "PostgreSQL JDBC Driver"). The PostgresqlJDBCAdapter uses the name to find the class.
      Our workaround is to add a file "postgres_jdbc_driver" to "META-INF/services/org/apache/activemq/store/jdbc" in the "activemq-jdbc-store-5.15.0.jar".

      Attachments

        1. postgresql_jdbc_driver
          1.0 kB
          Ch.Krauss

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              chk.futura Ch.Krauss
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: