Connecting to MS SQL database fails due to an 'Unable to get information from SQL Server' Error
The content on this page relates to platforms which are not supported for JIRA Applications. Consequently, Atlassian cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.
The JIRA application is unable to start.
The following error appears in the log file:
2010-09-20 15:11:18,678 main ERROR [jira.appconsistency.db.DatabaseConsistencyCheck] There was a SQL exception checking for database driver correctness. Skipping. org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unable to get information from SQL Server: localhost.) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.ofbiz.core.entity.transaction.JNDIFactory.getJndiConnection(JNDIFactory.java:212) at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:140) at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:99) at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:53)
When using a named instance, jTDS sends a UDP packet to the server over port 1434 to the SQL Browser Service to find the port that it can used to connect to the instance. It appears that this UDP request is not being replied to in time (if at all). This is usually because the SQL Browser service is not running. This is documented in Sourceforge's jTDS documentation:
On SQL Server 2005 the SQL Browser service must be running on the server host as the instance name lookup port UDP 1434 is hosted by this service on SQL Server 2005 rather than the SQL Server itself. The default install does not configure the SQL Browser service to start automatically so you must do it manually.
- Ensure that the SQL Browser service is running on your database server.
- Verify connectivity to your database with help of the JIRA Configuration Tool provided in JIRA versions 4.1 and above.
- Ensure that JDBC URL in
server.xmlis configured properly.
Alternatively, you can connect directly to the port used by the named instance. However, from Microsoft's documentation:
By default, when enabled, both named instances and SQL Server Express are configured to use dynamic ports, that is, an available port is assigned when SQL Server starts. If you want, a specific port can be assigned to an instance of SQL Server. When connecting, clients can specify a specific port; but if the port is dynamically assigned, the port number can change anytime SQL Server is restarted, so the correct port number is unknown to the client.
Thus, enabling the SQL Browser service is the more desirable option.