Fast Connection Failover (FCF) for oracle db?

340 views
Skip to first unread message

Jozef Hriadel

unread,
Feb 26, 2021, 3:19:20 AM2/26/21
to Payara Forum
Hi,

I need to configure Fast Connection Failover (FCF) for oracle db. Oracle documentation says, that It needs to use UCP data source. I don't know if I understand correctly what UCP, but I think that UCP is  custom oracle implementation of JDBC connection pool. 

It doesn't make sense to me how to configure UCP data source in payara, because payara has own implementation of JDBC connection pool.

How I configured JDBC connection pool:

I added ojdbc8.jar, ucp.jar and ons.jar to lib folder of payara. Then I tried to create new JDBC Connection Pool with Datasource Classname: oracle.ucp.jdbc.PoolDataSourceImpl, but I got Exception after ping: Invalid Universal Connection Pool configuration: java.sql.SQLException: Unable to create factory class instance with provided factory class name: java.lang.ClassNotFoundException:
Screenshot 2021-02-26 at 09.13.02.png
Do you have some experience how to setup FCF for oracle db in payara and use JDBC Pool as resource?

I found some guide how to migrate to UCP Pool, but then I cannot use @Resource annotation to inject  DataSource or use @PersistenceContext and work with database with simplicity.

Rudy De Busscher

unread,
Mar 2, 2021, 6:15:52 AM3/2/21
to Payara Forum
Hi Jozef,

Can you share the relevant pieces of the log that show more about the error.

It might be the case that the UCP driver is not compatible with the DataSource ResourceType. I have seen examples that uses XA datasources.

regards
Rudy

Jozef Hriadel

unread,
Mar 4, 2021, 2:19:46 AM3/4/21
to Rudy De Busscher, Payara Forum
Hi Rudy,

I found this error in my log.


[#|2021-03-04T08:16:45.846+0100|WARNING|Payara 5.201|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=914;_ThreadName=admin-thread-pool::admin-listener(5);_TimeMillis=1614842205846;_LevelValue=900;|RAR8054: Exception while creating an unpooled [test] connection for pool [ oracletest ], Connection could not be allocated because: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Error during pool creation in Universal Connection Pool Manager MBean: oracle.ucp.UniversalConnectionPoolException: Error during pool creation in Universal Connection Pool Manager: java.sql.SQLException: Invalid Universal Connection Pool configuration: java.sql.SQLException: Unable to create factory class instance with provided factory class name: java.lang.ClassNotFoundException: |#]

Any help?

--
You received this message because you are subscribed to a topic in the Google Groups "Payara Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/payara-forum/vO0sIPcZc_4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/9429ad83-7ac8-41ba-b2dd-32777aae688an%40googlegroups.com.


--
S pozdravom Jozef Hriadel

Rudy De Busscher

unread,
Mar 4, 2021, 2:43:18 AM3/4/21
to Payara Forum
Hi Jozef,

From what I find on internet, it seems a bug in the UCP driver. It's attempting to load the Oracle datasource class from the thread's context class loader instead of its own classloader.

Can you put the ucp.jar and ojdbc8.jar in the /modules directory and test it again? (this is not the recommended way and will not work out of the box with a other nodes in a Deployment group but should solve the classloader issue)

Regards
Rudy

Jozef Hriadel

unread,
Mar 4, 2021, 7:06:08 AM3/4/21
to Rudy De Busscher, Payara Forum
Hi Rudy,

thanks.

I tried to move libraries to modules folder. It doesn't work. Also my another jdbc pool with oracle.jdbc.pool.OracleDataSource have stopped working. I got similar exception for both jdbc pools.

Wrong class name or classpath for Datasource Object 
java.lang.ClassNotFoundException: oracle.ucp.jdbc.PoolDataSourceImpl /  

or

Wrong class name or classpath for Datasource Object 
java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource

Full stack trace is here:

[#|2021-03-04T12:50:27.803+0100|SEVERE|Payara 5.201|javax.enterprise.resource.resourceadapter.com.sun.gjc.util|_ThreadID=870;_ThreadName=admin-thread-pool::admin-listener(6);_TimeMillis=1614858627803;_LevelValue=1000;|RAR5099 : Wrong class name or classpath for Datasource Object 
java.lang.ClassNotFoundException: oracle.ucp.jdbc.PoolDataSourceImpl
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at com.sun.enterprise.loader.CurrentBeforeParentClassLoader.loadClass(CurrentBeforeParentClassLoader.java:83)
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 com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:264)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:110)
at com.sun.gjc.spi.ManagedConnectionFactoryImpl.getDataSource(ManagedConnectionFactoryImpl.java:1384)
at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:166)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:104)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:618)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:430)
at com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:1164)
at org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:145)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:558)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:554)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/javax.security.auth.Subject.doAs(Subject.java:361)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:553)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:584)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:576)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/javax.security.auth.Subject.doAs(Subject.java:361)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:575)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1496)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:120)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1878)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1754)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:272)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:240)
at org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommandLegacyFormat(TemplateExecCommand.java:156)
at org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGetLegacyFormat(TemplateCommandGetResource.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253)


Any idea?
Thanks.

You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/758c35e4-06ae-439b-b4b0-3723b2d1bb0cn%40googlegroups.com.

Rudy De Busscher

unread,
Mar 8, 2021, 7:18:39 AM3/8/21
to Payara Forum
Hi Jozef,

This needs further investigation and maybe a change within Payara.

Can you create a reproducer and file an enhancement request https://github.com/payara/Payara/issues. Remember that these enhancement requests are voted as indicated on https://github.com/payara/Payara/blob/master/SUPPORT.adoc and not immediately implemented.

Another option is the consideration of Payara Enterprise as enhancement requests from our customers get the highest priority.

Regards
Rudy
Reply all
Reply to author
Forward
0 new messages