1

I am trying to use a Postgres JDBC connection from WebLogic 14.1.1. I have added the Postgres JDBC jar to my domain's lib folder and added a datasource using the management console. The 'test' button at the end of the process indicates success. So far, so good.

However, when I try to actually use the connection, I get a ClassNotFound exception regarding some sort of WebLogic wrapper class. Here is the full stack trace:

    ####<Feb 23, 2023, 10:40:21,445 AM Central European Standard Time> <Error> <HTTP Session> <MacBook-Pro.local> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <fb856892-8489-4b11-beea-d232c77f0c0c-00000024> <167>
java.lang.AssertionError: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:225)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:190)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory$1.run(JDBCWrapperFactory.java:178)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:175)
        at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:229)
        at weblogic.jdbc.pool.Driver.connect(Driver.java:157)
        at weblogic.servlet.internal.session.JDBCSessionData.getConnection(JDBCSessionData.java:184)
        at weblogic.servlet.internal.session.JDBCSessionData.getSessionIds(JDBCSessionData.java:128)
        at weblogic.servlet.internal.session.JDBCSessionContext.getIdsInternal(JDBCSessionContext.java:246)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.cleanupExpiredSessions(SessionContext.java:703)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator$1.run(SessionContext.java:680)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.timerExpired(SessionContext.java:676)
        at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:301)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:677)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:651)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
Caused By: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:219)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:190)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory$1.run(JDBCWrapperFactory.java:178)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:175)
        at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:229)
        at weblogic.jdbc.pool.Driver.connect(Driver.java:157)
        at weblogic.servlet.internal.session.JDBCSessionData.getConnection(JDBCSessionData.java:184)
        at weblogic.servlet.internal.session.JDBCSessionData.getSessionIds(JDBCSessionData.java:128)
        at weblogic.servlet.internal.session.JDBCSessionContext.getIdsInternal(JDBCSessionContext.java:246)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.cleanupExpiredSessions(SessionContext.java:703)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator$1.run(SessionContext.java:680)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.timerExpired(SessionContext.java:676)
        at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:301)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:677)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:651)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)

I have located that PoolConnection class in the com.bea.core.datasource6.jar file under the modules folder under my WebLogic home folder. I have tried adding this jar to my domain's lib folder as well, but then the entire server refuses to start.

The strange thing is that the weblogic.utils.wrapper.WrapperFactory that tries to load the file comes from the same jar file, and that apparently can be found just fine.

I have no problems adding connections to Oracle databases, just Postgres is giving this issue.

Sietse
  • 7,884
  • 12
  • 51
  • 65
  • I still don’t know why, but it’s working as expected on an actual production-like server. It’s only broken on my local development instance. I still need to investigate which difference actually causes the problem. – Sietse Mar 27 '23 at 07:32

0 Answers0