File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Tomcat Web App not Conncecting to DB, after Tomcat Change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Web App not Conncecting to DB, after Tomcat Change" Watch "Tomcat Web App not Conncecting to DB, after Tomcat Change" New topic

Tomcat Web App not Conncecting to DB, after Tomcat Change

John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
Hey Guys,

I have just embedded tomcat out of my application, in favor of instead opting to use an external version. I have gotten as far as running the application, but have found that it cannot connect to the SQL database. When I look in the catalina.out(or the windows version of the file) this is the stack trace. I have all the libraries in the path, and version of the program with external tomcat is easily connecting. So either it has to do with the change from embedded to external tomcat or an upgrade from 5.5 to 6.0!


at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)
Caused by: Connection refused: connect
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at<init>(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
You could check firewall configuration or antivirus software. Most likely on of them is blocking an access.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Your SQL Server JDBC driver is failing to connect to Microsoft SQL Server. As Misha said, this is most likely a firewall problem, although there are some other possibilities, all related to basic networking issues.

A. You may not have SQL Server set up to respond to TCP/IP requests (I think by default it's disabled)

B. You may be attempting to connect using the wrong port number (default for SQL Server is 1433).

C. If it's an extremely busy server, it's possible that too many connections are already open.

D. SQL server might not be operating.

E. You might have an incorrect JDBC URL. For example, not pointed at the database host machine.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Tomcat Web App not Conncecting to DB, after Tomcat Change
It's not a secret anymore!