java - How to connect oracle database through tcps on tomcat -
i using tomcat 7, jdk 7.
my db oracle 11g.
i trying connect db tcps on tomcat.
some people have adding these lines.
url="jdbc:oracle:thin:@(description=(address=(protocol=tcps)(host=db ip)(port=port number))(connect_data=(service_name=db sid))) " connectionproperties="oracle.net.ssl_cipher_suites=ssl_dh_anon_with_3des_ede_cbc_sha,ssl_dh_anon_with_rc4_128_md5,ssl_dh_anon_with_des_cbc_sha"
so config file looks :
<resource name="jdbc/jedidatasource" auth="container" driverclassname="oracle.jdbc.driver.oracledriver" type="javax.sql.datasource" maxactive="40" maxidle="20" maxwait="-1" initialsize="1" username="cdw_admin" password="travel" removeabandoned="true" logabandoned="true" removeabandonedtimeout="60" validationquery="select 1 dual" url="jdbc:oracle:thin:@(description=(address=(protocol=tcps)(host=db ip)(port=port num))(connect_data=(service_name=db sid)))" connectionproperties="oracle.net.ssl_cipher_suites=ssl_dh_anon_with_3des_ede_cbc_sha,ssl_dh_anon_with_rc4_128_md5,ssl_dh_anon_with_des_cbc_sha"
but when start tomcat these settings error
경고: unexpected exception resolving reference org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create poolableconnectionfactory (io 예외 상황: network adapter not establish connection) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createpoolableconnectionfactory(basicdatasource.java:1549) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createdatasource(basicdatasource.java:1388) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.getlogwriter(basicdatasource.java:1098) @ org.apache.tomcat.dbcp.dbcp.basicdatasourcefactory.createdatasource(basicdatasourcefactory.java:350) @ org.apache.tomcat.dbcp.dbcp.basicdatasourcefactory.getobjectinstance(basicdatasourcefactory.java:156) @ org.apache.naming.factory.resourcefactory.getobjectinstance(resourcefactory.java:140) @ javax.naming.spi.namingmanager.getobjectinstance(namingmanager.java:321) @ org.apache.naming.namingcontext.lookup(namingcontext.java:793) @ org.apache.naming.namingcontext.lookup(namingcontext.java:140) @ org.apache.naming.namingcontext.lookup(namingcontext.java:781) @ org.apache.naming.namingcontext.lookup(namingcontext.java:153) @ org.apache.catalina.core.namingcontextlistener.addresource(namingcontextlistener.java:1020) @ org.apache.catalina.core.namingcontextlistener.createnamingcontext(namingcontextlistener.java:629) @ org.apache.catalina.core.namingcontextlistener.lifecycleevent(namingcontextlistener.java:237) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:119) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4540) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:791) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:771) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:546) @ org.apache.catalina.startup.hostconfig.deploydescriptor(hostconfig.java:637) @ org.apache.catalina.startup.hostconfig.deploydescriptors(hostconfig.java:563) @ org.apache.catalina.startup.hostconfig.deployapps(hostconfig.java:498) @ org.apache.catalina.startup.hostconfig.start(hostconfig.java:1277) @ org.apache.catalina.startup.hostconfig.lifecycleevent(hostconfig.java:321) @ org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:119) @ org.apache.catalina.core.containerbase.start(containerbase.java:1053) @ org.apache.catalina.core.standardhost.start(standardhost.java:785) @ org.apache.catalina.core.containerbase.start(containerbase.java:1045) @ org.apache.catalina.core.standardengine.start(standardengine.java:445) @ org.apache.catalina.core.standardservice.start(standardservice.java:519) @ org.apache.catalina.core.standardserver.start(standardserver.java:710) @ org.apache.catalina.startup.catalina.start(catalina.java:581) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:498) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:289) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:414) caused by: java.sql.sqlexception: io 예외 상황: network adapter not establish connection @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:111) @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:145) @ oracle.jdbc.driver.databaseerror.throwsqlexception(databaseerror.java:254) @ oracle.jdbc.driver.t4cconnection.logon(t4cconnection.java:386) @ oracle.jdbc.driver.physicalconnection.<init>(physicalconnection.java:413) @ oracle.jdbc.driver.t4cconnection.<init>(t4cconnection.java:164) @ oracle.jdbc.driver.t4cdriverextension.getconnection(t4cdriverextension.java:34) @ oracle.jdbc.driver.oracledriver.connect(oracledriver.java:752) @ org.apache.tomcat.dbcp.dbcp.driverconnectionfactory.createconnection(driverconnectionfactory.java:38) @ org.apache.tomcat.dbcp.dbcp.poolableconnectionfactory.makeobject(poolableconnectionfactory.java:582) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.validateconnectionfactory(basicdatasource.java:1556) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createpoolableconnectionfactory(basicdatasource.java:1545) ... 37 more 8월 18, 2017 11:16:46 오전 org.apache.catalina.core.namingcontextlistener addresource 경고: failed register in jmx: javax.naming.namingexception: cannot create poolableconnectionfactory (io 예외 상황: network adapter not establish connection) webinitializer instanciated.
my database set tcps settings, want connect tomcat , database through tcps.
could me fix error? thanks
Comments
Post a Comment