tomcat7连接oracle的Connection refused问题解决

tomcat的server.xml配置如下:

        <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="60"
          maxIdle="20"
          maxWait="10000"
          removeAbandoned="true"
          removeAbandonedTimeout="60"
          logAbandoned="true"/>

报错信息如下:

java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169870592)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
org.apache.tapestry.ApplicationRuntimeException
org.apache.tapestry.ApplicationRuntimeException: Unable to invoke method dataImportByTxt on com.company.sale[email protected]7e907e90[effectevaluation.DataImport]: null
component:	com.company.sale[email protected]7e907e90[effectevaluation.DataImport]
location:	context:/realuser/report/effectevaluation/DataImport.page, line 7, column 99

java.lang.RuntimeException
org.apache.tapestry.ApplicationRuntimeException: Unable to invoke method dataImportByTxt on com.company.sale[email protected]7e907e90[effectevaluation.DataImport]: null
Stack 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]: null
org.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)
... 32 more
Caused by: java.lang.reflect.InvocationTargetException
sun.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)
... 35 more
Caused 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:105)
com.company.sale.view.realuser.report.effectevaluation.DataImportList.dataImportByTxt(DataImportList.java:126)
... 40 more
Caused 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)
... 49 more

猜测是sid写错了,查询一下,果然:

select INSTANCE_NAME from v$instance;

把ngacct_s1改为ngacct1即可。

2015.3.5

时间: 2024-10-09 05:21:29

tomcat7连接oracle的Connection refused问题解决的相关文章

scp出现ssh port 22: Connection refused 问题解决具体步骤

[root(0)@sys11 09:20:29 /home/work/Code_release/bj]# scp ./release.sh  [email protected]:/Users/a2014102/Downloadsssh: connect to host 192.168.161.151 port 22: Connection refusedlost connection Solution: One possible reason is that because the ssh se

[故障解决]Ssh连接port 22: Connection refused

金山云有一个服务器需要连接到数据库但是总是失败,检查之后发现它的VPC配错了,更改VPC之后,这台服务器也会更换一个新的内网IP地址,但是问题来了,更换了内网IP之后,从跳板机连接,提示port 22: Connection refused. #ssh -v 新的ip地址,发现根本没有到Connection established.直接就提示port 22: Connection refused.这基本可以断定不是跳板机的问题了,那么就需要在远程机器里看配置. 但是远程机器是无法连接的啊,怎么办

本地使用Navicat远程连接Oracle报错ORA-28547问题解决

用Navicat连接Oracle数据库时出现如下错误 按照数据库连接信息去连接就好了,注意的是默认的Server Name是ORCL,记得改成你要连接的数据库名: 在进行连接测试的时候,出现了报错信息ORA-28547:connection to server failed,probable Oracle Net admin error: 后来去网上搜索一下发现,因为Navicat是通过Oracle客户端连接Oracle服务器,我们用Navicat时通常会在自己的安装路径下包含多个版本的OCI,

MobaXterm连接Ubuntu显示connection refused

#如果没有发现ssh进程说明ssh没有启动 [email protected]:~$ ps -e | grep ssh #在服务端启动服务[email protected]:~$ service ssh startssh: unrecognized service #在本机远程到服务端bogon:~ macname$ ssh [email protected]ssh: connect to host 192.168.1.108 port 22: Connection refused #出现以上错

eclipe连接oracle获取Connection

import java.sql.Connection; import java.sql.DriverManager; import pers.xkk.telbook.util.Constant; public class DBHelper { private Connection conn = null; public DBHelper() { try { Class.forName(Constant.JDBC_NAME);// 指定连接类型 this.conn = DriverManager.

网络连接返回getsockopt: connection refused错误原因 及 listen

客户端访问的ip写错或者服务端的listen ip写错 listen(":8080") ==  listen("0.0.0.0:8080") 可以用127.0.0.1:8080访问,也可以用网卡ip:8080访问 listen("127.0.0.1:8080")只能通过127.0.0.1:8080访问,目前所知一般用于代理转发到127.0.0.1:8080,如nginx的proxy_pass

com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection refused: connect

问题描述:最简单的数据库连接报错,到主机  的 TCP/IP 连接失败.(win 7 操作系统) 错误信息: com.microsoft.sqlserver.jdbc.SQLServerException: 到主机  的 TCP/IP 连接失败. java.net.ConnectException: Connection refused: connect package sqlconnect; import java.sql.*; public class sqlconnect { public

java连接oracle数据库,关闭连接出现异常:java.sql.SQLRecoverableException: IO Error: Connection reset

java.sql.SQLRecoverableException: IO Error: Connection reset at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:612) at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:5094) at com.sms.send.StartTaskNew.run(SmsSend.java

navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法

原文:navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法 navicat是通过oracle客户端连接oracle服务器的. oracle的客户端有两种,一种标准的客户端安装程序,下载地址: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html