Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4013

PostgresLargeObjectManager does incorrectly unwrap the jdbc connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.25.0
    • 2.27.0
    • Broker
    • None

    Description

      The PostgresLargeObjectManager unwraps in an unusual and non-conformative way. It should just do connection.unwrap(PGConnection.class) instead of the unusual reflection stuff.

      This currently prevents usage of Artemis alongside Testcontainers as it results in this exception:

      java.lang.ClassCastException: class org.testcontainers.jdbc.ConnectionWrapper cannot be cast to class org.postgresql.PGConnection (org.testcontainers.jdbc.ConnectionWrapper and org.postgresql.PGConnection are in unnamed module of loader 'app')
      	at org.apache.activemq.artemis.jdbc.store.file.PostgresLargeObjectManager.createLO(PostgresLargeObjectManager.java:69)
      	at org.apache.activemq.artemis.jdbc.store.file.PostgresSequentialSequentialFileDriver.createFile(PostgresSequentialSequentialFileDriver.java:64)
      	at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactoryDriver.openFile(JDBCSequentialFileFactoryDriver.java:109)
      	at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFile.load(JDBCSequentialFile.java:110)
      	at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFile.open(JDBCSequentialFile.java:104)
      	at org.apache.activemq.artemis.core.paging.impl.PagingStoreFactoryDatabase.reloadStores(PagingStoreFactoryDatabase.java:220)
      	at org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl.reloadStores(PagingManagerImpl.java:326)
      	at org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl.start(PagingManagerImpl.java:430)
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:3160)
      	at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:68)
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:655)
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:568)
      	at org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ.start(EmbeddedActiveMQ.java:116)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jedmeier Johannes Edmeier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m