Link to home
Start Free TrialLog in
Avatar of aloknet21
aloknet21Flag for India

asked on

MS SQL Connection Error while running war file from Jetty Server

Hi,

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.
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

"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.
Avatar of aloknet21

ASKER

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.
I have checked the connection settings from application now. it is as per below:

db.url=jdbc:sqlserver://10.31.1.33;DatabaseName=orktnu
db.user=mytest
db.password=qwer56t!
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver

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

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial