This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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
Author

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!

Thanks,

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:230)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:285)
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: 15665
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Web App not Conncecting to DB, after Tomcat Change
 
Similar Threads
Executing DBTestRunner from "SCJD Exam with J2SE 5 Platform"
DBTester and DBTestRunner in Max's book
Why my RMI connection throw exceptions?
new to servlet
Missing something creating a DataSource, MySql 5.0, MyEclipse 6.5, Tomcat 6