TOMCAT7 connecting Oracle to connection refused problem solving

Source: Internet
Author: User
Tags oracleconnection

The Server.xml configuration for Tomcat is as follows:

        <resource name= "jdbc/uopact1ds"          auth= "Container"          type= "Javax.sql.DataSource"             factory= " Org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory "          driverclassname=" Oracle.jdbc.driver.OracleDriver          " Url= "JDBC:ORACLE:THIN:@30.51.9.26:1521:NGACCT_S1"          username= "Uop_act1"          password= "eb_1234"          maxActive = "Maxidle=" "          maxwait=" 10000 "          removeabandoned=" true "          removeabandonedtimeout="          Logabandoned= "true"/>
The error message is as follows:

Java.sql.SQLException:Io Exception:connection refused (description= (tmp=) (vsnnum=169870592) (err=12505) (error_ Stack= (Error= (code=12505) (emfi=4)))) Org.apache.tapestry.ApplicationRuntimeExceptionorg.apache.tapestry.ApplicationRuntimeException:Unable to invoke Method Dataimportbytxt on Com.company.sale[email protected]7e907e90[effectevaluation. DataImport]: nullcomponent:com.company.sale[email protected]7e907e90[effectevaluation. Dataimport]location:context:/realuser/report/effectevaluation/dataimport.page, line 7, column 99 Java.lang.RuntimeExceptionorg.apache.tapestry.ApplicationRuntimeException:Unable to invoke Method Dataimportbytxt On Com.company.sale[email protected]7e907e90[effectevaluation. DataImport]: Nullstack trace:org.apache.tapestry.listener.listenermap$syntheticlistener.actiontriggered ( listenermap.java:121) org.apache.tapestry.form.Submit.renderComponent (submit.java:80) Org.apache.tapestry.AbstractComponent.render (abstractcomponent.java:859) org.apache.tapestry.aBstractcomponent.renderbody (abstractcomponent.java:626) org.apache.tapestry.form.Form.renderComponent (Form.java : 366) Org.apache.tapestry.AbstractComponent.render (abstractcomponent.java:859) Org.apache.tapestry.form.Form.rewind (form.java:601) Org.apache.tapestry.engine.RequestCycle.rewindForm ( requestcycle.java:432) Org.apache.tapestry.form.Form.trigger (form.java:615) Org.apache.tapestry.engine.DirectService.service (directservice.java:169) Org.apache.tapestry.engine.AbstractEngine.service (abstractengine.java:890) Org.apache.tapestry.ApplicationServlet.doService (applicationservlet.java:200) Org.apache.tapestry.ApplicationServlet.doPost (applicationservlet.java:329) Javax.servlet.http.HttpServlet.service (httpservlet.java:646) Javax.servlet.http.HttpServlet.service ( httpservlet.java:727) Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter ( applicationfilterchain.java:303) Org.apache.catalina.core.ApplicationFilterChain.doFilter ( applicationfilterchain.java:208) Org.apache.catalina.core.StandardWRappervalve.invoke (standardwrappervalve.java:220) Org.apache.catalina.core.StandardContextValve.invoke ( standardcontextvalve.java:122) Org.apache.catalina.authenticator.AuthenticatorBase.invoke ( authenticatorbase.java:503) Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:170) Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:103) Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:950) Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:116) Org.apache.catalina.ha.tcp.ReplicationValve.invoke (replicationvalve.java:333) Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:421) Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp11processor.java:1070) Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (abstractprotocol.java:611) Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (jioendpoint.java:316) Java.util.concurrent.threadpoolexecutor$worker.runtask (Threadpoolexecutor.java:897) Java.util.concurrent.threadpoolexecutor$worker.run (ThreadPoolExecutor.java:919) Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61) Java.lang.Thread.run ( thread.java:736) caused By:org.apache.tapestry.ApplicationRuntimeException:Unable to invoke method Dataimportbytxt on Com.company.sale[email protected]7e907e90[effectevaluation. DataImport]: Nullorg.apache.tapestry.listener.ListenerMap.invokeTargetMethod (listenermap.java:304) Org.apache.tapestry.listener.listenermap.access$1 (listenermap.java:269) Org.apache.tapestry.listener.listenermap$syntheticlistener.invoke (listenermap.java:103) Org.apache.tapestry.listener.listenermap$syntheticlistener.actiontriggered (listenermap.java:110) ... Morecaused By:java.lang.reflect.InvocationTargetExceptionsun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:60) Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:37) Java.lang.reflect.Method.invoke (method.java:611) Org.apache.tapestry.listener.ListenerMap.invokeTargetMethod (listenermap.java:278) ... morecaused by:org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot Create poolableconnectionfactory (Io Exception:connection refused (description= (tmp=) (vsnnum=169870592) (err=12505) (error_stack= (ERROR= (CODE=12505) ( emfi=4))) 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.getConnection (basicdatasource.java:1044) Com.company.dbframework.jdbc.ConnectionManager.getConnection (connectionmanager.java:172) Com.company.webframework.tapestry.BaseData.getDBConn (basedata.java:365) com.company.dbframework.baseentity.< Init> (baseentity.java:39) com.company.component.appentity.<init> (appentity.java:32) Com.company.sale.bean.realuser.report.effectEvaluation. Datanumberlistdao.<init> (DATANUMBERLISTDAO.JAVA:18) Com.company.sale.bean.realuser.report.effectevaluation.DataImportBean.importSerialnumber (Dataimportbean.java : Com.company.sale.view.realuser.report.effectevaluation.DataImportList.dataImportByTxt (Dataimportlist.java : 126) ... morecaused by:java.sql.SQLException:Io Exception:connection refused (description= (tmp=) (vsnnum=169870592) (err= 12505) (error_stack= (Error= (code=12505) (emfi=4))) Oracle.jdbc.dbaccess.DBError.throwSqlException (Dberror.java : 134) Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:179) Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:333) oracle.jdbc.driver.oracleconnection.<init > (oracleconnection.java:404) oracle.jdbc.driver.OracleDriver.getConnectionInstance (oracledriver.java:468) Oracle.jdbc.driver.OracleDriver.connect (oracledriver.java:314) 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) ... More


Guess is SID write wrong, query, sure enough:

Select instance_name from V$instance;
Change the ngacct_s1 to Ngacct1.

This article originates from: Ouyida3 's CSDN Blog

2015.3.5

TOMCAT7 connecting Oracle to connection refused problem solving

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.