473,413 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Java Web Server 6.1 & Pooled SQL Server 2000 JDBC Connections - Problems

If 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 simple 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 of...
JDBC Test
Registering JDBC Driver
driverClass: com.microsoft.jdbc.sqlserver.SQLServerDriver loaded and
registered.
Driver Information
Driver Name: SQLServer
Driver Version: 2.2.0037
Database Information
Database Name: Microsoft SQL Server
Database Version: Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec
17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: )
Avalilable Catalogs
catalog: master
catalog: msdb
catalog: Northwind
catalog: pubs
catalog: tempdb

4. This tells me that the web server has access to the files necessary
and the classpath is configured correctly.

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(N amingManager.java:301)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:834)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:181)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:822)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:181)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:822)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:181)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:822)
org.apache.naming.NamingContext.lookup(NamingConte xt.java:194)
org.apache.naming.SelectorContext.lookup(SelectorC ontext.java:183)
javax.naming.InitialContext.lookup(InitialContext. java:347)
_jsps._jdbctest_jsp._jspService(_jdbctest_jsp.java :236)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
javax.servlet.http.HttpServlet.service(HttpServlet .java:908)
com.iplanet.ias.web.jsp.JspServlet$JspServletWrapp er.service(JspServlet.java:667)
com.iplanet.ias.web.jsp.JspServlet.serviceJspFile( JspServlet.java:447)
com.iplanet.ias.web.jsp.JspServlet.service(JspServ let.java:363)
javax.servlet.http.HttpServlet.service(HttpServlet .java:908)
org.apache.catalina.core.StandardWrapperValve.invo keServletService(StandardWrapperValve.java:771)
org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:322)
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:509)
org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:212)
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:509)
org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:209)
org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:509)
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor .process(NSAPIProcessor.java:161)
com.iplanet.ias.web.WebContainer.service(WebContai ner.java:586)

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="..."/>
<PROPERTY name="portNumber" value="1433"/>
<PROPERTY name="User" value="..."/>
<PROPERTY name="Password" value="..."/>
</JDBCCONNECTIONPOOL>
<JDBCRESOURCE jndiname="jdbc/devjwscp" poolname="devjwscp"
enabled="on"/>
</RESOURCES>

Code snippet... should look familiar to you all...
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/devjwscp");
Connection poolConn = ds.getConnection();

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, but none of them offered any explaination or remedy.

Do I need to incorporate a sub-web.xml file entry as a solution?

Thanks in advance.

Jason
Jul 17 '05 #1
0 4467

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
1
by: bogachkov | last post by:
Hello Joe Over the past several years, I have found your responses to jdbc usage/driver related issues to be extremely helpful. I am sure that you're very busy so I will make my question as...
8
by: Rhino | last post by:
I'm trying to use the JDBC Universal driver to get a Type 4 connection in a Java client program running under DB2 V8.2.1 but I keep getting a "connection refused: connect" message. I'm running...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
2
by: soup_or_power | last post by:
How do I configure the MS-SQLSERVER to accept JDBC connections and process the sql? I'm using SQLSERVER 2000 on Windows NT. Thanks for your help
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
66
by: flarosa | last post by:
Hi, I'm wondering if I can get a reasonably civil (without starting any huge wars) opinion on how server-side PHP compares to server-side Java. I've been strictly a Java developer for almost...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.