title: Error fetching SQL Server 2008 database with JBOSS Tools 3.3 and JBOSS 7.1
body: <p>While trying to create a Hibernate Configuration using JBOSS Tools (to access a database schema in SQLServer 2008) I get an error.</p>
  
  <p>After creating the Hibernate Mapping file (an empty one) and the Hibernate Configuration File, and the Console Configuration, I try to open the Database in the the Hibernate configuration, I get this error: </p>
  
  <pre><code>org.hibernate.exception.JDBCConnectionException: Getting database metadata
  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
  at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:63)
  at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearch(AbstractMetaDataDialect.java:163)
  at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:22)
  at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476)
  at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
  at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:126)
  at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
  at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
  at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:115)
  at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:65)
  at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
  at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
  
  Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host XX.XX.XX.XX, port 1433 has failed. Error: "Connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
  at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
  at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:241)
  at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2243)
  at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:491)
  at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1309)
  at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
  at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
  at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
  at org.hibernate.eclipse.libs.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:42)
  at java.sql.DriverManager.getConnection(Unknown Source)
  at java.sql.DriverManager.getConnection(Unknown Source)
  at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
  at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getConnection(AbstractMetaDataDialect.java:121)
  at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:60)
  ... 12 more
  </code></pre>
  
  <p>The hibernate.cfg.xml is like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;password&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:sqlserver://XX.XX.XX.XX:1433;DatabaseName=TESTDEV&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;TEST&lt;/property&gt;
      &lt;property name="hibernate.default_schema"&gt;TESTDEV&lt;/property&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/property&gt;
  &lt;/session-factory&gt;
  </code></pre>
  
  <p></p>
  
  <p>Am I doing anything wrong or is this a problem of JBoss Tools?</p>
  
  <p>EDIT:
  While creating a console configuration, if I choose the "database connection" and edit it,it also fails to test the connection, getting the same error as before:</p>
  
  <pre><code>Ping failed: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.16.14.36, port 1433 has failed. Error: "Connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
  </code></pre>
  
  <p>I can access the database with the same properties using SQuirreL, or by pinging in an Eclipse that doesn't have JBoss Tools installed...</p>