jboss-3.0.3_tomcat-4.1.12 MSSQL 2000 Connection problem, Ple
ngod Nov 6, 2002 8:19 PMHello,
I keep getting "java.sql.SQLException: No suitable driver" when trying to connect to MSSQL 2000 using MS jdbc driver, I have jboss-3.0.3+Tomcat-4.1.12 bundle, I had the same problem with jboss-3.0.0+Tomcat-4.0.3 bundle. Jboss started up fine and other examples is working fine but I could never get it to talk to MSSQL 2000, I got Tomcat to talk to MSSQL 2000 fine using servlet.
I looked though all the postings and still could not figure out what I am missing, it seems like it could not find the jar files, but they're all there.
Please help.
Below are my setup:
1) My classpath is pointing to the three jar files:
/usr/local/msSQLjdbc/lib/msbase.jar:/usr/local/msSQLjdbc/lib/mssqlserver.jar:/usr/local/msSQLjdbc/lib/msutil.ja
2) the three jar files are also in the /lib directory
lib/msbase.jar
lib/mssqlserver.jar
lib/msutil.jar
3) my mssql-service.xml is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- ======================================================================-->
<!-- New ConnectionManager setup for Microsoft SQL Server 2000 driver -->
<!-- You may download the latest Microsoft JDBC driver from *Microsoft* -->
<!-- http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/779
/msdncompositedoc.xml&frame=true -->
<!-- Build jmx-api (build/build.sh all) and view for config documentation -->
<!-- ===================================================================== -->
<!-- Include a login module configuration named MSSQLDbRealm.
Update your login-conf.xml, here is an example for a
ConfiguredIdentityLoginModule:
<application-policy name = "MSSQLDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">yourprincipal</module-option>
<module-option name = "userName">yourusername</module-option>
<module-option name = "password">yourpassword</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-opti
on>
</login-module>
</application-policy>
NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
module-option name = "managedConnectionFactoryName"
must match the object name of the ConnectionManager you are configuring here.
-->
<!--comment out this line if you are using the MSSQLDbRealm above-->
MSSQLDbRealm
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
MSSQLDS
<config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://hunter:1433;Selec
tMethod=cursor;DatabaseName=extraitems</config-property>
<config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</
config-property>
<!--set these only if you want only default logins, not through JAAS
<config-property name="UserName" type="java.lang.String">sa</config-property>
<config-property name="Password" type="java.lang.String"></config-property>-->
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransa
ction JDBC Wrapper
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
0
50
5000
15
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depe
nds>
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</
depends>
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
4) Below are the changes I made in the standardjbosscmp-jdbc.xml
java:/MSSQLDS
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
5) Below are the changes I made in the standardjaws.xml
java:/MSSQLDS
<type-mapping>MS SQLSERVER2000</type-mapping>
false
Thank you.