[jboss-user] [Datasource Configuration] - Trouble with MS SQL 2005 and JBoss 4.0.5 - Tomcat works though?

Mike Romero do-not-reply at jboss.com
Thu Sep 9 07:59:31 EDT 2010

Mike Romero [http://community.jboss.org/people/romerom] created the discussion

"Trouble with MS SQL 2005 and JBoss 4.0.5 - Tomcat works though?"

To view the discussion, visit: http://community.jboss.org/message/560946#560946

Hey Guys,

I have a webapp that I'm trying to port from Tomcat to JBoss.  There are two datasources.  One is MySQL, one is MSSQL 2005.

I was able to get the MySQL datasource working in JBoss, but MS SQL is giving me the strangest error.  "Connection Refused".  I know the error itself isn't strange at all, it's just that... there is no network or firewall issue.  There is no issue about the SQL server being down or not listening on that port.

Tomcat works.  JBoss 4.0.5 doesn't.  I haven't tried other versions of JBoss; this is just the version we use here where I work so I am setting my environment up to match theirs.


<resource-ref>   <description>Helios</description>


<?xml version="1.0" encoding="UTF-8"?> <jboss-web> 
</resource-ref> </jboss-web>



  <xa-datasource-property name="ServerName">hostname.domain.edu</xa-datasource-property>  
  <xa-datasource-property name="PortNumber">5555</xa-datasource-property>  
  <xa-datasource-property name="DatabaseName">dbname</xa-datasource-property>  
  <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>  
  <xa-datasource-property name="User">user</xa-datasource-property>  
  <xa-datasource-property name="Password">pass</xa-datasource-property>  
  <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <type-mapping>MS SQLSERVER2005</type-mapping>

I've been through a few different SQL configs in that "sql-ds.xml" file based on various examples on the web.  The problem is always the same - "Connection Refused".

The problem is that I can connect using SQL Server Management Studio as well as from within Eclipse when my webapp is started in Tomcat.  It's just that for some reason, JBoss doesn't seem to get it.  Another little nugget.  Telnet to the port? Nope, that doesn't work.  From a server on the same segment, telnet doesn't work either.

I started out with an older version of "sqljdbc.jar", then upgraded to 2.0, then 3.0, then attempted to use the "jtds" driver.  Each of these produce "Connection Refused".  I've tried with and without JNDI as well.  Same problem  :(   This is truly puzzling.

Any ideas? Is there some compatibility issue between SQL Server 2005 and JBoss 4.0.5?  The one thing I noticed is that the example above uses the type-mapping of "MS SQLSERVER2005", only, in "standardjbosscmp-jdbc.xml", there is no entry for 2005, only "MS SQLSERVER" and "MS SQLSERVER2000".  This leads me to believe that a newer version of JBoss might have additional support for SQL Server 2005 and that I might just be going against the stream.

Hopefully you guys have some ideas  :) 

Why does SQL Server Management Studio and Tomcat work?  Why does JBoss fail with a "Connection Refused" similarly to the way Telnet does?

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100909/8116c99f/attachment-0001.html 

More information about the jboss-user mailing list