Highlighted

Unable to connect to database through oracle think driver

Avatar

Avatar

ramgopalm545617

Avatar

ramgopalm545617

ramgopalm545617

04-12-2018

We are receiving the below error while trying to establish a connection to database through oracle thin client. request to please help here.

PFB configurations done for the pooled data source connection.

  datasource.name = oracle_fta

  datasource.svc.prop.name = datasource.name

  datasource.svc.properties = []

  defaultAutoCommit = Default

  defaultCatalog =

  defaultReadOnly = Default

  defaultTransactionIsolation = Default

  driverClassName = oracle.jdbc.driver.OracleDriver

  initSQL =

  initialSize = 10

  jdbcInterceptors = StatementCache;SlowQueryReport(threshold=10000);ConnectionState

  logValidationErrors = true

  maxActive = 100

  maxAge = 0

  maxIdle = 100

  maxWait = 30000

  minEvictableIdleTimeMillis = 60000

  minIdle = 10

  password = ********

  service.factoryPid = org.apache.sling.datasource.DataSourceFactory

  service.pid = org.apache.sling.datasource.DataSourceFactory.562debd3-59ee-4747-85c6-1a747dc6fcd0

  testOnBorrow = false

  testOnReturn = false

  testWhileIdle = false

  timeBetweenEvictionRunsMillis = 5000

  url = jdbc:oracle:thin:@lnbrorad02:1580:tenv2_fta

  username = aemforms

  validationInterval = 30000

  validationQuery =

  validationQueryTimeout = -1

ERROR Snippet:

04.12.2018 10:34:31.303 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.datasource.DataSourceFactory.562debd3-59ee-4747-85c6-1a747dc6fcd0)] org.apache.sling.datasource [org.apache.sling.datasource.DataSourceFactory(5516)] The modified method has thrown an exception (java.sql.SQLException: The Network Adapter could not establish the connection)

java.sql.SQLException: The Network Adapter could not establish the connection

        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413)

        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)

        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)

        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)

        at org.apache.sling.datasource.internal.DriverDataSource.getConnection(DriverDataSource.java:85)

        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:224)

        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)

        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:713)

        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:647)

        at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)

        at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:145)

        at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)

        at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)

        at org.apache.sling.datasource.internal.DataSourceFactory$LazyJmxRegisteringDataSource.createPool(DataSourceFactory.java:364)

        at org.apache.sling.datasource.internal.DataSourceFactory.modified(DataSourceFactory.java:228)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)

        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)

        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)

        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)

        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)

        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)

        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:772)

        at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:727)

        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:645)

        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)

        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)

        at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:277)

        at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1881)

        at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1849)

        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)

        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)

        at java.lang.Thread.run(Thread.java:745)

Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection

        at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:328)

        at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:421)

        at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:630)

        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:206)

        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)

        ... 36 common frames omitted

Caused by: java.net.ConnectException: Connection refused

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

        at java.net.Socket.connect(Socket.java:589)

        at java.net.Socket.connect(Socket.java:538)

        at java.net.Socket.<init>(Socket.java:434)

        at java.net.Socket.<init>(Socket.java:211)

        at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:127)

        at oracle.net.nt.ConnOption.connect(ConnOption.java:126)

        at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:306)

        ... 41 common frames omitted

Replies

Highlighted

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

04-12-2018

The settings look fine to me, have you uploaded the Oracle JDBC driver bundled as JAR?

Highlighted

Avatar

Avatar

ramgopalm545617

Avatar

ramgopalm545617

ramgopalm545617

04-12-2018

yes, we have uploaded it as a JAR directly to the felix console

Highlighted

Avatar

Avatar

ramgopalm545617

Avatar

ramgopalm545617

ramgopalm545617

04-12-2018

PFB details of the bundle, please help us if we have to change anything in the bundle.

Note: we are able to connect trough oci driver through local using the same bundle, but not able to connect through thin driver in local instance as well.

ojdbc6-osgiojdbc6-osgi

Symbolic Nameojdbc6-osgi
Version11.1.0
Bundle Locationinputstream:ojdbc6-osgi-11.1.0.jar
Last ModificationWed Nov 28 09:53:39 EST 2018
VendorOracle
DescriptionOSGi wrapper bundle for Oracle JDBC driver for Java 6.
Start Level20
Exported Packagesoracle.core.lmx,version=11.1.0
oracle.core.lvf,version=11.1.0
oracle.jdbc,version=11.1.0
oracle.jdbc.aq,version=11.1.0
oracle.jdbc.connector,version=11.1.0
oracle.jdbc.dcn,version=11.1.0
oracle.jdbc.driver,version=11.1.0
oracle.jdbc.internal,version=11.1.0
oracle.jdbc.oci,version=11.1.0
oracle.jdbc.oracore,version=11.1.0
oracle.jdbc.pool,version=11.1.0
oracle.jdbc.rowset,version=11.1.0
oracle.jdbc.util,version=11.1.0
oracle.jdbc.xa,version=11.1.0
oracle.jdbc.xa.client,version=11.1.0
oracle.jpub.runtime,version=11.1.0
oracle.net.ano,version=11.1.0
oracle.net.aso,version=11.1.0
oracle.net.jdbc.TNSAddress,version=11.1.0
oracle.net.jdbc.nl,version=11.1.0
oracle.net.jdbc.nl.mesg,version=11.1.0
oracle.net.jndi,version=11.1.0
oracle.net.mesg,version=11.1.0
oracle.net.ns,version=11.1.0
oracle.net.nt,version=11.1.0
oracle.net.resolver,version=11.1.0
oracle.security.o3logon,version=11.1.0
oracle.security.o5logon,version=11.1.0
oracle.sql,version=11.1.0
oracle.sql.converter,version=11.1.0
oracle.sql.converter_xcharset,version=11.1.0
Imported Packagesjavax.crypto,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.crypto.spec,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.management,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.naming,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.naming.directory,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.naming.spi,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.net,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.net.ssl,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.security.auth,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.security.auth.callback,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.security.auth.kerberos,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.security.cert,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.sql,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.sql.rowset,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.sql.rowset.spi,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
javax.transaction.xa,version=1.1.0 from org.apache.aries.transaction.manager (27)
javax.xml.parsers,version=0.0.0.fragment_xml from org.apache.felix.framework (0)
org.ietf.jgss,version=0.0.0.1_008_JavaSE from org.apache.felix.framework (0)
org.w3c.dom,version=0.0.0.fragment_xml from org.apache.felix.framework (0)
org.xml.sax,version=0.0.0.fragment_xml from org.apache.felix.framework (0)
org.xml.sax.helpers,version=0.0.0.fragment_xml from org.apache.felix.framework (0)
Importing Bundlesday.commons.datasource.jdbcpool (445)
Manifest HeadersBnd-LastModified: 1537838936538
Build-Jdk: 1.8.0_181
Built-By: lidrdgx
Bundle-Description: OSGi wrapper bundle for Oracle JDBC driver for Java 6.
Bundle-License: non-free
Bundle-ManifestVersion: 2
Bundle-Name: ojdbc6-osgi
Bundle-SymbolicName: ojdbc6-osgi
Bundle-Vendor: Oracle
Bundle-Version: 11.1.0
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *; scope=compile|runtime; type=!pom; inline=true
Export-Package: oracle.core.lmx; version="11.1.0", oracle.core.lvf; version="11.1.0", oracle.jdbc; version="11.1.0"; uses:="oracle.jdbc.aq, oracle.jdbc.dcn, oracle.jdbc.driver, oracle.jdbc.internal, oracle.jdbc.pool, oracle.sql", oracle.jdbc.aq; version="11.1.0"; uses:="oracle.jdbc, oracle.sql", oracle.jdbc.connector; version="11.1.0"; uses:="javax.resource, javax.resource.spi, javax.resource.spi.endpoint, javax.security.auth, javax.sql, javax.transaction.xa", oracle.jdbc.dcn; version="11.1.0"; uses:="oracle.jdbc, oracle.sql", oracle.jdbc.driver; version="11.1.0"; uses:="javax.management, javax.transaction.xa, oracle.jdbc, oracle.jdbc.aq, oracle.jdbc.dcn, oracle.jdbc.internal, oracle.jdbc.oracore, oracle.jdbc.pool, oracle.jdbc.xa.client, oracle.net.ns, oracle.sql", oracle.jdbc.internal; version="11.1.0"; uses:="javax.transaction.xa, oracle.jdbc, oracle.jdbc.oracore, oracle.jdbc.pool, oracle.sql", oracle.jdbc.oci; version="11.1.0"; uses:="oracle.jdbc.driver", oracle.jdbc.oracore; version="11.1.0"; uses:="oracle.jdbc.internal, oracle.sql", oracle.jdbc.pool; version="11.1.0"; uses:="javax.naming, javax.naming.spi, javax.sql, javax.transaction.xa, oracle.jdbc, oracle.jdbc.driver, oracle.jdbc.internal, oracle.jdbc.oci", oracle.jdbc.rowset; version="11.1.0"; uses:="javax.sql, javax.sql.rowset, javax.sql.rowset.spi, oracle.jdbc, oracle.jdbc.internal", oracle.jdbc.util; version="11.1.0", oracle.jdbc.xa; version="11.1.0"; uses:="javax.sql, javax.transaction.xa, oracle.jdbc.pool", oracle.jdbc.xa.client; version="11.1.0"; uses:="javax.sql, javax.transaction.xa, oracle.jdbc.driver, oracle.jdbc.internal, oracle.jdbc.xa", oracle.jpub.runtime; version="11.1.0"; uses:="oracle.jdbc, oracle.jdbc.driver, oracle.jdbc.internal, oracle.sql", oracle.net.ano; version="11.1.0"; uses:="oracle.net.aso, oracle.net.ns", oracle.net.aso; version="11.1.0", oracle.net.jdbc.TNSAddress; version="11.1.0"; uses:="oracle.net.jdbc.nl", oracle.net.jdbc.nl; version="11.1.0", oracle.net.jdbc.nl.mesg; version="11.1.0", oracle.net.jndi; version="11.1.0"; uses:="javax.net, javax.net.ssl, oracle.net.ns", oracle.net.mesg; version="11.1.0", oracle.net.ns; version="11.1.0"; uses:="oracle.net.ano, oracle.net.nt", oracle.net.nt; version="11.1.0"; uses:="javax.net.ssl, oracle.net.jdbc.nl, oracle.net.ns", oracle.net.resolver; version="11.1.0"; uses:="oracle.net.jdbc.TNSAddress, oracle.net.ns, oracle.net.nt", oracle.security.o3logon; version="11.1.0", oracle.security.o5logon; version="11.1.0", oracle.sql; version="11.1.0"; uses:="oracle.jdbc, oracle.jdbc.driver, oracle.jdbc.internal, oracle.jdbc.oracore, oracle.sql.converter", oracle.sql.converter; version="11.1.0"; uses:="oracle.i18n.text.converter, oracle.jdbc.internal", oracle.sql.converter_xcharset; version="11.1.0"
Import-Package: com.sun.security.auth.module; resolution:=optional, javax.crypto; resolution:=optional, javax.crypto.spec; resolution:=optional, javax.management; resolution:=optional, javax.naming; resolution:=optional, javax.naming.directory; resolution:=optional, javax.naming.spi; resolution:=optional, javax.net; resolution:=optional, javax.net.ssl; resolution:=optional, javax.resource; resolution:=optional, javax.resource.spi; resolution:=optional, javax.resource.spi.endpoint; resolution:=optional, javax.resource.spi.security; resolution:=optional, javax.security.auth; resolution:=optional, javax.security.auth.callback; resolution:=optional, javax.security.auth.kerberos; resolution:=optional, javax.security.cert; resolution:=optional, javax.sql; resolution:=optional, javax.sql.rowset; resolution:=optional, javax.sql.rowset.spi; resolution:=optional, javax.transaction.xa; resolution:=optional, javax.xml.parsers; resolution:=optional, oracle.i18n.text; resolution:=optional, oracle.i18n.text.converter; resolution:=optional, oracle.ons; resolution:=optional, oracle.security.pki; resolution:=optional, org.ietf.jgss; resolution:=optional, org.w3c.dom; resolution:=optional, org.xml.sax; resolution:=optional, org.xml.sax.helpers; resolution:=optional
Manifest-Version: 1.0
Tool: Bnd-2.1.0.20130426-122213
Highlighted

Avatar

Avatar

apurvg6618346

Avatar

apurvg6618346

apurvg6618346

18-12-2019

Did you find the solution for this? I am also getting the same error.