"user" should be "username". This changed from the old Tyrex config to the newer DBCP config.

Jake

At 02:25 PM 12/10/2002 +0530, you wrote:
My server.xml file now looks like this:

<DefaultContext reloadable="true" debug="4">
<Resource name="jdbc/rtidb" auth="CONTAINER"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/rtidb">
<parameter>
<name>user</name>
<value>realtime</value>
</parameter>
<parameter>
<name>password</name>
<value>realtime</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>driverName</name>
<value>jdbc:oracle:thin:@rti:1521:rti</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</DefaultContext>

The CLASSPATH is:
/usr/local/jdk/lib/tools.jar:/usr/local/jdk/lib/dt.jar:/usr/local/tomcat/web
apps/rti/WEB-INF/classes:/usr/local/oracle:/usr/local/oracle:/usr/local/tomc
at/lib/naming-factory.jar:/usr/local/tomcat/common/lib/naming-resources.jar:
/usr/local/tomcat/common/lib/naming-common.jar:.

classes12.zip has been renamed classes12.jar and has been copied in
$CATALINA_HOME/common/lib and also in directory /usr/local/oracle

Following is what i see in catalina.out:

XmlMapper: new null org.apache.catalina.deploy.ContextResource resource-ref
ContextResource[name=null, scope=Shareable]
XmlMapper: org.apache.catalina.deploy.ContextResource.setDescription( Oracle
Datasource example)
XmlMapper: org.apache.catalina.deploy.ContextResource.setName( jdbc/rtidb)
XmlMapper: org.apache.catalina.deploy.ContextResource.setType(
javax.sql.DataSource)
XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth( Container)
XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource
ContextResource[name=jdbc/rtidb, description=Oracle Datasource example,
type=javax.sql.DataSource, auth=Container, scope=Shareable]
XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource:
ContextResource[name=jdbc/rtidb, description=Oracle Datasource example,
type=javax.sql.DataSource, auth=Container, scope=Shareable]


hmm... First of all, whats that "null" doing up there in line 1? Does anyone
else see the same in their logs? What am i doing wrong?

Regards,
Manav.


-----Original Message-----
From: Pedro Salazar [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:57 PM
To: Tomcat Users List
Cc: Troy Campano; [EMAIL PROTECTED]
Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!


Greetings,

I find a way of put it to work (tested on 4.0.4, 4.1.2).
I put the <Resource> inside a *<DefaultContext>*. I couldn't put it to
work inside a specific <context> or even through a <resourceLink> to a
global resource.

Now, I don't know why is that happens! I'm deploying in war file, and
apparently my <context> element I put in server.xml isn't mapping
resources right:

<context docBase="ngincare.war" debug="0"
reloadable="true"
path="ngincare">
{<Resource>+<ResourceParam>|<ResourceLink>}
</context>

If you could explain this, it would be just fine! For now I'll use the
<DefaultContext>...

thanks,
Pedro Salazar

On Mon, 2002-12-09 at 16:09, Manavendra Gupta wrote:
> Hi Pedro,
>
> Welcome to the club - there are a number of ppl facing the exact same
> problem, but are unable to find answer.
>
> Do let me know what you did if you find a solution.
>
> Manav.
>
> -----Original Message-----
> From: Pedro Salazar [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 9:12 PM
> To: Tomcat Users List
> Subject: RE: oracle+tomcat 4.1.x+dbcp = driverClassName is required!
>
>
> Greetings,
>
> Eric, I'm getting a "javax.naming.NameNotFoundException: Name jdbc is
> not bound in this Context" exception!
>
> I have a resource link inside my context (no resource here or
> resource-ref in web.xml):
>
> <resourceLink name="jdbc/ngincaredb"
> global="jdbc/ngincaredb_global"
> type="javax.sql.DataSource" />
>
> and I'm doing a lookup in my code for "jdbc/ngincaredb":
>
> Context initCtx = new InitialContext();
> Context envCtx = (Context)initCtx.lookup("java:comp/env");
> this.ds = (DataSource)envCtx.lookup("/jdbc/ngincaredb");
>
> So, what's wrong here?
>
> thanks,
> Pedro Salazar.
>
> On Mon, 2002-12-09 at 13:06, Roberts, Eric wrote:
> > Pedro,
> >
> > You need javax.sql - that is the package containing DataSource.
> > Your Resource type should be: type="javax.sql.DataSource"
> > You need these parameters in addition to url, username and password:
> > <parameter>
> > <name>driverClassName</name>
> > <value>oracle.jdbc.driver.OracleDriver</value>
> > </parameter>
> > <parameter>
> > <name>factory</name>
> > <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> > </parameter>
> >
> > In the Context the ResourceLink type should be:
> type="javax.sql.DataSource"
> >
> > You do not need any resource-ref in your web.xml - just use your
> ResourceLink name as follows:
> > Context ctx = new InitialContext();
> > Context envCtx = (Context) ctx.lookup("java:/comp/env/");
> > DataSource ds = (DataSource) envCtx.lookup("/{name_of_resource_link}");
> >
> > if (ds != null) {
> > DbCon = ds.getConnection();
> > }
> >
> > Hope this helps.
>
> --
> pedro salazar (pt-inovacao) <[EMAIL PROTECTED]>
> key id: D803BC61
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
pedro salazar (pt-inovacao) <[EMAIL PROTECTED]>
key id: D803BC61


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to