My project was using ojdbc6
with c3p0
connection pooling . This i moved to ojdbc8
and UCP(Oracle's universal connection pooling)
. But i am getting below error:
UCP Config
used:
try
{
//Creating a pool-enabled data source
pds= PoolDataSourceFactory.getPoolDataSource();
String dbURL="jdbc:oracle:thin:@(DESCRIPTION = (CONNECT_TIMEOUT= 15)(RETRY_COUNT=20)(RETRY_DELAY=3) (ADDRESS_LIST =(LOAD_BALANCE=on)(ADDRESS = (PROTOCOL = TCP) (HOST = vm-host-101) (PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = S1NAME)))";
//this is where am using that package
pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
pds.setURL(dbURL);
pds.setUser("username");
pds.setPassword("password");
pds.setInitialPoolSize(5);
pds.setMinPoolSize(5);
pds.setMaxPoolSize(10);
pds.setFastConnectionFailoverEnabled(false);
return pds;
}
catch(SQLException e)
{
e.printStackTrace();
}
return pds;
}
Error:
Caused by: java.sql.SQLException: Unable to create factory class instance with provided factory class name: java.lang.SecurityException: sealing violation: package oracle.jdbc.pool is sealed
at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:456) ~[ucp-12.2.0.1.jar:12.2.0.1.0]
at oracle.ucp.util.UCPErrorHandler.throwSQLException(UCPErrorHandler.java:133) ~[ucp-12.2.0.1.jar:12.2.0.1.0]
at oracle.ucp.jdbc.PoolDataSourceImpl.initConnectionFactory(PoolDataSourceImpl.java:3243) ~[ucp-12.2.0.1.jar:12.2.0.1.0]
at oracle.ucp.jdbc.PoolDataSourceImpl.createUniversalConnectionPool(PoolDataSourceImpl.java:1105) ~[ucp-12.2.0.1.jar:12.2.0.1.0]
... 61 common frames omitted
Caused by: java.lang.SecurityException: sealing violation: package oracle.jdbc.pool is sealed
I understand the error will come when we have 2 class
loaded from same package
. But i checked in external dependencies in intellij
and also tried mvn dependency:tree
command of maven
. I couldn't find duplicate OJDBC jars
in classpath
.
Is there any other reason for this?