Sounds reasonable. Now if I could just get it to work! :-) As long as
I've got your attention...
I'm following the steps under
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html for
JDBC Data Sources using these mods:
context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="jdbc/OESDB" auth="Container"
type="javax.sql.DataSource"
username="dbuser" password="password"
url=""
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
driverClassName="org.postgresql.Driver"
maxActive="20" maxIdle="10"/>
</Context>
WEB-INF/web.xml
<resource-ref>
<description>
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
</description>
<res-ref-name>
jdbc/OESDB
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
Java code
InitialContext initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/OESDB");
Connection db = ds.getConnection();
And here's what I'm getting back:
Sun Jan 21 13:58:21 CST 2007 - exception returned from call to Vendor:
e = java.lang.RuntimeException: SQL in Vendor.Save:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
Anything obvious? I'm still working it but if something jumps out, I'd
appreciate the help.
Thanx,
Garth
Schalk wrote:
Hey
Garth,
No, I reckon that if you need all applications under Tomcat to have
access to DBCP access then adding that in Tomcat itself should be fine.
However, if there is anything that is Axis/Web Service specific then it
would be better to edit the web.xml under Axis for these settings as
apposed to enforcing this on all application loaded by the container.
HTH
Schalk
Garth Keesler wrote:
Good info. It raises another question,
however. If I am setting up DBCP for Tomcat, why does the config go in
the web.xml for Axis and not Tomcat? Dumb question but does that mean
that any servlet accessing the database via DBCP must run under Axis?
Just curious,
Garth
Ajith Ranabahu wrote:
Hi guys,
Here is a small description to de-mystify this whole business of aars
and wars :)
The Axis2 war is a packaged version of the complete Axis2 setup, ready
to be deployed in a servlet container. aar files on the other hand are
archived service bundles that include class files, a descriptor file
called the services.xml and may be jar files needed by the service.
aar files go inside the Axis2 web app and cannot survive alone inside
a servlet container. There is NO web.xml inside the aar file. If there
is a reference to a web.xml that probably means the web.xml inside the
Axis2 war.
As far as your situation is considered I guess you should edit the
Axis2/WEB-INF/web.xml that you'll find inside the tomcat webapps
directory. The web.xml inside the conf is a global setting and editing
that will enforce the same configuration to all the webapps running in
your server.
Ajith
On 1/21/07, Schalk <[EMAIL PROTECTED]> wrote:
No problem, pleasure Garth.
Garth Keesler wrote:
> I'm not sure what name you go by but, Schalk, you pointed me in
the
> right direction! I modified the Tomcat web.xml file in the conf
> directory and now, at least, the errors I'm getting indicate that
the
> database pooled connection was actually made. Now maybe I can make
> some progress.
>
> If I could assign points in this list, I'd give 'em to you. :-)
>
> Thanx much,
> Garth
>
> Schalk wrote:
>> Greetings,
>>
>> I am using Axis2 and have successfully edited the web.xml as
well as
>> added .jar's to the lib without any problems.
>>
>> Glen Mazza wrote:
>>> Hello, I have a question--is the process of altering the
web.xml
>>> file and adding JARs to the lib directory of the axis.war
file to
>>> accomodate service classpath needs more or less the same
in both
>>> Axis2 and Axis1? I think they would be, but the
instructions I
>>> see[1] appear to be for Axis1, so I don't know if anything
is
>>> substantially different for Axis2--not much is mentioned
about
>>> altering the web.xml files or adding JARs to the WAR lib
directory
>>> in the Axis2 docs[2].
>>>
>>> Thanks,
>>> Glen
>>>
>>> [1]
>>>
http://ws.apache.org/axis/java/install.html#Step5InstallingNewWebServices
>>>
>>> [2]
>>>
http://ws.apache.org/axis2/1_1_1/installationguide.html#servlet_container
>>>
>>>
>>>
>>> Schalk wrote:
>>>> Hey Garth,
>>>>
>>>> I am pretty sure you would need to edit the web.xml
inside the axis
>>>> distribution. Your .aar file should go into the
services directory
>>>> inside the axis distribution.
>>>>
>>>> Garth Keesler wrote:
>>>>
>>>>> I am attempting to deploy a web service that
utilizes Database
>>>>> Connection Pooling (DBCP). The examples (both
official Apache and
>>>>> unofficial) all discuss adding a
<resource-ref> section to the
>>>>> /WEB-INF/web.xml file but I can find no examples
of an .aar file
>>>>> that have a /WEB-INF directory or a web.xml file
included. Where
>>>>> in the .aar file do I include the web.xml file?
>>>>>
>>>>> Thanx,
>>>>> Garth
>>>>>
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
[EMAIL PROTECTED] For
>>>>> additional commands, e-mail:
[EMAIL PROTECTED]
>>>>>
------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG Free Edition.
>>>>> Version: 7.5.432 / Virus Database: 268.17.3/642 -
Release Date:
>>>>> 1/20/2007 10:31 PM
>>>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
[EMAIL PROTECTED]
>>> For additional commands, e-mail:
[EMAIL PROTECTED]
>>>
>>>
>>>
>>
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> .
>>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]
>
------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.3/642 - Release Date:
1/20/2007 10:31 PM
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.3/642 - Release Date:
1/20/2007 10:31 PM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
|