yz3162611
2009-04-14 10:28
浏览 1.8k
已采纳

JDBC连接oracle 出问题:Listener refused the connection!

我现在在做一个小项目,环境是MYECLIPS6+TOMCAT5+ORACLE10g
当我在页面浏览时,总出现间接性的数据库连接错误,郁闷了很久。。

下面是MYECLIPSE中报的错误:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
192.168.133.250:1521:oracle

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:279)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:318)
at oracle.jdbc.driver.PhysicalConnection. (PhysicalConnection.java:343)
at oracle.jdbc.driver.T4CConnection. (T4CConnection.java:147)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.zjsoft.zjsj.util.Database.getConnection(Database.java:59)
at org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:79)
at org.zjsoft.zjsj.dao.impl.DepartmentDAOImpl.getDepartmentByID(DepartmentDAOImpl.java:41)
at org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.setData(ApplyTypeDAOImpl.java:104)
at org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.getApplyTypeByID(ApplyTypeDAOImpl.java:25)
at org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.setDataList(ApplyDAOImpl.java:151)
at org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.listApplyByStatus(ApplyDAOImpl.java:36)
at org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doPost(AcceptStatusServlet.java:42)
at org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doGet(AcceptStatusServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.zjsoft.zjsj.filter.EncodingFilter.doFilter(EncodingFilter.java:25)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)

下面是我浏览器上显示的错误:
java.lang.NullPointerException
org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:81)
org.zjsoft.zjsj.dao.impl.DepartmentDAOImpl.getDepartmentByID(DepartmentDAOImpl.java:41)
org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.setData(ApplyTypeDAOImpl.java:104)
org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.getApplyTypeByID(ApplyTypeDAOImpl.java:25)
org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.setDataList(ApplyDAOImpl.java:151)
org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.listApplyByStatus(ApplyDAOImpl.java:36)
org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doPost(AcceptStatusServlet.java:42)
org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doGet(AcceptStatusServlet.java:24)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.zjsoft.zjsj.filter.EncodingFilter.doFilter(EncodingFilter.java:25)

org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:81)代码如下:
private Connection getConnection() {
Connection connection = null;
try {
Class.forName(DBDRIVER); // 加载数据库驱动类
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
connection = DriverManager.getConnection(DBURL, USER, PASSWORD); } catch (SQLException e) {
e.printStackTrace();
}
return connection;
}

[b]问题补充:[/b]
项目都做了这么久了 不可能再改数据库了 修改连接试了下

连接数已经改为300了 但还是出现那个错误啊

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

8条回答 默认 最新

相关推荐 更多相似问题