• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

MS SQL Connection Error while running war file from Jetty Server


While i am running a war file from Jetty Server, below error i am facing. please suggest.

I am using MS-SQL 2005 Server for database.

INFO [populateTaskDashIssuesGrid has started] (JournalIssueAction.java:3637) - populateTaskDashIssuesGrid
 INFO [populateTaskDashIssuesGrid has started] (JournalIssueAction.java:3642) - user id for tasks : 4499
 INFO [populateTaskDashIssuesGrid has started] (JournalIssueAction.java:3654) - find : Find
 INFO [populateTaskDashIssuesGrid has started] (JournalIssueAction.java:3660) - retun size : 16
 INFO [returnIssueTaskHistoryAction has started] (JournalIssueAction.java:3124) - returnIssueTaskHistoryAction
 INFO [returnIssueTaskHistoryAction has started] (JournalIssueAction.java:3126) - history for issueId : 2101
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection timed out
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(Unknown Source)
        at main.java.com.pts.options.journal.daos.JournalIssueDaoImpl.fetchTasksHistory(JournalIssueDaoImpl.java:2433)
        at main.java.com.pts.options.journal.delegate.JournalIssueServiceImpl.fetchTasksHistory(JournalIssueServiceImpl.java:544)
        at main.java.com.pts.options.journals.struts2.actions.JournalIssueAction.returnIssueTaskHistoryAction(JournalIssueAction.java:3128)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Appreciate any help to resolve this issue.
  • 2
  • 2
1 Solution
Gerwin Jansen, EE MVETopic Advisor Commented:
"com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection timed out"

Please verify your connection settings in the datasource for the application and check whether you can connect from your Jetty server to the database.
aloknet21Author Commented:
Please guide me the steps to check the connection from jetty server to database. also the steps to verify connection settings in the data source for the application.

thank you very much for your reply.
aloknet21Author Commented:
I have checked the connection settings from application now. it is as per below:


Do i need to define Port 1433 here. please suggest.

Gerwin Jansen, EE MVETopic Advisor Commented:
Yes you need to define a port number as well, like "db.port=1433" but where are your settings from? They're not in XML format, where did you get them from?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now