|
msmamet (Programmer) |
23 Jul 04 14:23 |
f anyone can shed some light on this problem I would greatly appreciate it.
I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web Server 6.1 with the SQL Server 2000 JDBC Driver.
The background: 1. I have downloaded the SQL Server 2000 JDBC Driver and installed it on the web server. 2. I used the Administration GUI to add the .jars(namely msbase.jar, msutil.jar, and mssqlserver.jar), to the classpath. 3. Upon creating a simply JSP to access connection metadata using the direct connect method, ie.,
Class.forName( com.microsoft.jdbc.sqlserver.SQLServerDriver); Connection con = DriverManager.getConnection( "jdbc:microsoft:sqlserver:// ....
I am shown a successful output.
Now the fun begins... In order to set up the JDBC Connection Pool I have done the following... 1. I have created a web.xml file for the web-app which contains the JSP and includes the following entry <resource-ref> <res-ref-name>jdbc/devjwscp</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> 2. I have used the "JDBC Connection Pools" link under the "Java" tab in the Administration GUI to create a connection pool. "Pool Name:" is "devjwscp" "DataSource Classname" is set to "com.microsoft.jdbcx.sqlserver.SQLServerDataSource". All other properties have been left alone. 3. I have used the "JDBC Resources" link under the "Java" tab in the Administration GUI to create a JNDI resource. "JNDI Name" is set to "jdbc/devjwscp" "Status" is "true" "Pool Name" is "devjwscp" The web-app JSP comes back with the following exception. JDBC Test Exception Thrown Cannot create resource instance javax.naming.NamingException: Cannot create resource instanceorg.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167) javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) org.apache.naming.NamingContext.lookup(NamingContext.java:834) org.apache.naming.NamingContext.lookup(NamingContext.java:181)
4. FYI my server.xml <RESOURCE> entry looks as is shown below <RESOURCES> <JDBCCONNECTIONPOOL name="devjwscp" datasourceclassname="com.microsoft.jdbcx.sqlserver.SQLServerDataSource" steadypoolsize="8" maxpoolsize="32" poolresizequantity="2" idletimeout="300" maxwaittime="60000" connectionvalidationrequired="off" connectionvalidationmethod="auto-commit" validationtablename="" failallconnections="off" transactionisolationlevel="read-uncommitted" isolationlevelguaranteed="off"> <PROPERTY name="serverName" value="secret"/> <PROPERTY name="portNumber" value="1433"/> <PROPERTY name="User" value="secret"/> <PROPERTY name="Password" value="secret"/> </JDBCCONNECTIONPOOL> <JDBCRESOURCE jndiname="jdbc/devjwscp" poolname="devjwscp" enabled="on"/> </RESOURCES>
What gives? Do I need to add anything else to the server.xml? I know the server.xml for JWS differs from Apache. I have done an exhaustive search of the web. Many other individuals have had the same thing happen, buy none of them offered any explaination or remedy.
Thanks in advance. |
|