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