I've spent the last couple of days familiarizing myself with the new 5.0.19,
especially the JNDI connection pooling.  I tried, unsuccessfully, to use the
admin console to set up JDNI datasources as well as editing the xml files
directly following the instructions in the documentation.  The only way I
was able to get the connection pooling to work was to manually create a
context in the server.xml and add the resources there.  This worked great.
The documentation for Tomcat 5 looks suspiciously like the Tomcat 4 so I
think it is not updated yet.  

Ben

-----Original Message-----
From: Daniel Savard [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 08, 2004 9:53 PM
To: Tomcat Users List
Subject: Re: JNDI Datasource Reference in DD Not Necessary?

Doug,

I really hope someone will shed some light on this, because I struggle
to make my JNDI DataSource definition working properly with 5.0.19. And
it seems the Resources still need to be defined in the server.xml even
if the documentation for 5.0.19 is saying you should no longer put your
Context definitions in the server.xml, but rather in the context.xml in
the META-INF directory packaged with your application. It is supposed to
make possible changes in the context without having to restart Tomcat.

But, I was not able to make this working as documented... ;-( Since I am
a newbie, I sticked as much as possible on the instructions. But, it
seems not to work as documented.


Le lun 08/03/2004 � 22:21, Parsons Technical Services a �crit :
> Harry,
> 
> Take a look at this page:
>
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/globalresources.html
> 
> As noted on the page:
> "This is equivalent to the inclusion of the following element in the web
> application deployment descriptor (/WEB-INF/web.xml): "
> 
> The question is: Is the fragment below inside a context for your
application
> or is in the GlobalNamingResources section?
> 
> I just swapped mine to Global and dropped the segment in the web.xml. I
> didn't try it while I had it in the context of the app.
> 
> Doug
> www.parsonstechnical.com
> 
> 
> ----- Original Message ----- 
> From: "Harry Mantheakis" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Monday, March 08, 2004 3:37 PM
> Subject: JNDI Datasource Reference in DD Not Necessary?
> 
> 
> > Hello
> >
> > For some time now I have implemented the Tomcat 'JNDI DataSource' How-To
> on
> > connection pooling, and everything has been fine.
> >
> > I define a resource in the context fragment:
> >
> >
> >     <Resource name="jdbc/postgres"
> >               auth="Container"
> >               type="javax.sql.DataSource"/>
> >
> >     <ResourceParams name="jdbc/postgres">
> >         ...
> >     </ResourceParams>
> >
> >
> > And a resource reference to it in the deployment descriptor:
> >
> >
> >     <resource-ref>
> >         <description>DB Connection</description>
> >         <res-ref-name>jdbc/postgres</res-ref-name>
> >         <res-type>javax.sql.DataSource</res-type>
> >         <res-auth>Container</res-auth>
> >     </resource-ref>
> >
> >
> > And then do a JNDI lookup at runtime:
> >
> >
> >     return ( DataSource )new InitialContext().
> >         lookup( "java:comp/env/jdbc/postgres" );
> >
> >
> > Magic.
> >
> > The other day I noticed that the resource reference in my deployment
> > descriptor was actually broken - the name did not match that defined in
> the
> > context - and yet my application was still working - perfectly.
> >
> > When I thought about it, it occurred to me that the resource reference
in
> > the deployment descriptor may not actually be necessary.
> >
> > So I deleted the resource reference from the web.xml file, and
everything
> > still works as expected.
> >
> > Can anyone enlighten me?
> >
> > Many thanks in anticipation.
> >
> > Harry Mantheakis
> > London, UK
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]
> 
> 
-- 

=======================================
Daniel Savard
Consultation Informatique Daniel Savard

=======================================



---------------------------------------------------------------------
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]

Reply via email to