Hello, I had some troubles trying to get into the forum. And I want to tell you guys that I solved the issue and now my application is perfectly getting the connection through integrated security (I had to change the driver cuz
MSSQL driver DOES NOT ALLOW conecction through Windows Authentication, it only allows connections trhough SQL Server Authentication), now I want to show step by step what i finally did to achieve it (like a cookery recipe).
1. Download the Microsoft SQL Server JDBC Driver 2.0 from
http://www.microsoft.com/.
2. Unzip the driver (it doesn't really matter the path.. just remember it).
3. Copy the file C:\Program files\Microsoft SQL Server JDBC Driver 2.0\sqljdbc_2.0\enu\
sqljdbc.jar and place it in JBOSS_HOME\server\default\lib.
4. To configure the driver so that it allows to make connections through Windows Authentication, you must copy the file C:\Program files\Microsoft SQL Server JDBC Driver 2.0\sqljdbc_2.0\enu\auth\x86\
sqljdbc_auth.dll and add it in C:\WINDOWS\system32.
5. The *-ds.xml file now looks like this:
NOTE: Since you set
integratedSecurity=true the sqljdbc_auth.dll determines the current Windows user's credentials to log into de database.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSSIBLE ERRORS:
*
ERROR [STDERR] 13/08/2009 11:35:42 AM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll
This error its because you dont added the sqljdbc_auth.dll in in C:\WINDOWS\system32.
* Its very important to know that the <driver-class> its not the same one for MSSQL driver than Microsoft SQL Server JDBC Driver 2.0. The name its veri similar and I was having troubles because of this, and it took me lonng time to find out what was it
MSSQL <driver-class> - com.microsoft.
jdbc.sqlserver.SQLServerDriver
Microsoft SQL Server JDBC Driver 2.0 <driver-class> - com.microsoft.
sqlserver.jdbc.SQLServerDriver
If you keep using the MSSQL <driver-class>, since this driver allows only SQL Server Authentication (it need a user name and pass) you get this error:
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.)
*
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.microsoft.sqlserver.jdbc.SQLServerDriver; - nested throwable: (java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver))
This error its because you didnt placed the sqljdbc.jar in JBOSS_HOME\server\default\lib.
Hope its helpful!
Thanks a lot Peter and Jaikiran four your help guys.
Saludos desde Mexico!