Created 07-26-2017 06:16 AM
We are successfully able to connect database using url ==> jdbc:oracle:thin:@//<database_server>:<port>/<service>
but when we use ldap url as below we are getting error, same ldap url works perfectly for Hive and Ranger
jdbc:oracle:thin:@ldap://<ldap_server>:<port>/<service>,cn=OracleContext,dc=<domain>,dc=com
Error as below :::
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: <openjpa-2.2.2-r422266:1468616 fatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot create PoolableConnectionFactory (IO Error: JNDI Package failure javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn= xxxx') at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603) at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1518) at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:531) at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:456) at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:120) at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68) at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:967) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:958) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:644) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:203) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60) at org.apache.oozie.service.JPAService.getEntityManager(JPAService.java:513) at org.apache.oozie.service.JPAService.init(JPAService.java:214) at org.apache.oozie.service.Services.setServiceInternal(Services.java:386) at org.apache.oozie.service.Services.setService(Services.java:372) at org.apache.oozie.service.Services.loadServices(Services.java:305) ... 26 more Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (IO Error: JNDI Package failure javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=xxxx') at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110) at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87) at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91) ... 46 more Caused by: java.sql.SQLRecoverableException: IO Error: JNDI Package failure javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=xxxx' at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) ... 51 more Caused by: oracle.net.ns.NetException: JNDI Package failure javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=xxxx' at oracle.net.jndi.JndiAttrs.getAttrs(JndiAttrs.java:210) at oracle.net.resolver.AddrResolution.<init>(AddrResolution.java:205) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:223)
Created 07-26-2017 06:33 AM
The following error indicates that the basename that you are using might not be correct:
Caused by: java.sql.SQLRecoverableException: IO Error: JNDI Package failure javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=xxxx'
.
Can you please check the "cn=xxxx" (cn=OracleContext,dc=<domain>,dc=com) that you entered is correct or not? (using a simple standalone java code can help to reproduce this issue to isolate the cause)
.
Created 07-26-2017 06:57 AM
same ldap url is working for Hive and Ranger hence basename is correct. Error shows service name in cn which I have replaced with xxxx as "cn=xxxx" but in our case cn=OracleContext.
Created 07-26-2017 08:27 AM
Also able to do connection to oozie database from CLI using ldap url as below
/usr/java/jdk1.8.0_60/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/hdp/current/oozie-server/libext/oracle-jdbc-driver.jar org.apache.ambari.server.DBConnectionVerification 'jdbc:oracle:thin:@ldap://<ldap_server>:<port>/<service>,cn=OracleContext,dc=<domain>,dc=com' oozie <password> oracle.jdbc.driver.OracleDriver Connected to DB Successfully!