You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Johannes Edmeier (Jira)" <ji...@apache.org> on 2022/09/23 14:09:00 UTC

[jira] [Created] (ARTEMIS-4013) PostgresLargeObjectManager does incorrectly unwrap the jdbc connection

Johannes Edmeier created ARTEMIS-4013:
-----------------------------------------

             Summary: PostgresLargeObjectManager does incorrectly unwrap the jdbc connection
                 Key: ARTEMIS-4013
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4013
             Project: ActiveMQ Artemis
          Issue Type: Bug
          Components: Broker
    Affects Versions: 2.25.0
            Reporter: Johannes Edmeier


The PostgresLargeObjectManager unwraps in a unusual and non-confirmative 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:


{code:java}
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) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)